summaryrefslogtreecommitdiffstats
path: root/src/openvg/qvgimagepool.cpp
diff options
context:
space:
mode:
authorJani Hautakangas <jani.hautakangas@nokia.com>2011-02-28 20:48:12 (GMT)
committerJani Hautakangas <jani.hautakangas@nokia.com>2011-03-01 06:14:16 (GMT)
commit4e464f42d5933dcc8535f978e25eeb7fd8a57284 (patch)
treeea7c623055e2aa67be15f7f2df9db13fe9ff634d /src/openvg/qvgimagepool.cpp
parentae6bc1d824f5ae24a259be0c68241873cb96739f (diff)
downloadQt-4e464f42d5933dcc8535f978e25eeb7fd8a57284.zip
Qt-4e464f42d5933dcc8535f978e25eeb7fd8a57284.tar.gz
Qt-4e464f42d5933dcc8535f978e25eeb7fd8a57284.tar.bz2
Add internal function for releasing cached GPU resources.
Task-number: QTBUG-17849 Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/openvg/qvgimagepool.cpp')
-rw-r--r--src/openvg/qvgimagepool.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/openvg/qvgimagepool.cpp b/src/openvg/qvgimagepool.cpp
index a2b1c4e..35cf2f5 100644
--- a/src/openvg/qvgimagepool.cpp
+++ b/src/openvg/qvgimagepool.cpp
@@ -175,8 +175,19 @@ bool QVGImagePool::reclaimSpace(VGImageFormat format,
void QVGImagePool::hibernate()
{
- // Nothing to do here at the moment since the pool does not
- // retain VGImage's after they have been released.
+ Q_D(QVGImagePool);
+ QVGPixmapData *pd = d->lruLast;
+ while(pd) {
+ QVGPixmapData *prevLRU = pd->prevLRU;
+ pd->inImagePool = false;
+ pd->inLRU = false;
+ pd->nextLRU = 0;
+ pd->prevLRU = 0;
+ pd->hibernate();
+ pd = prevLRU;
+ }
+ d->lruFirst = 0;
+ d->lruLast = 0;
}
void QVGImagePool::moveToHeadOfLRU(QVGPixmapData *data)