diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2012-02-15 11:32:02 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-15 13:46:25 +0100 |
commit | 5f0013ee76605b9c7ceab168702b57e797b698e0 (patch) | |
tree | 9bdf47ba3b81199bcfe234a2346813e888052a9a /src/quick/util | |
parent | 3c3b9956c6ba18c424027ec77dfcddbe7bac60b9 (diff) |
Introduced QQuickCanvas::releaseResources().
This function can be used in certain situations to purge the texture cache
and triggers more lazily to take down the scene graph and GL context
Change-Id: Icd9360ff50fda0e721ba0f1b520cda678e457a35
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/quick/util')
-rw-r--r-- | src/quick/util/qdeclarativepixmapcache.cpp | 12 | ||||
-rw-r--r-- | src/quick/util/qdeclarativepixmapcache_p.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/quick/util/qdeclarativepixmapcache.cpp b/src/quick/util/qdeclarativepixmapcache.cpp index 43ce3346cb..95cbd361b8 100644 --- a/src/quick/util/qdeclarativepixmapcache.cpp +++ b/src/quick/util/qdeclarativepixmapcache.cpp @@ -695,6 +695,8 @@ public: void unreferencePixmap(QDeclarativePixmapData *); void referencePixmap(QDeclarativePixmapData *); + void purgeCache(); + protected: virtual void timerEvent(QTimerEvent *); @@ -827,6 +829,16 @@ void QDeclarativePixmapStore::timerEvent(QTimerEvent *) } } +void QDeclarativePixmapStore::purgeCache() +{ + shrinkCache(m_unreferencedCost); +} + +void QDeclarativePixmap::purgeCache() +{ + pixmapStore()->purgeCache(); +} + QDeclarativePixmapReply::QDeclarativePixmapReply(QDeclarativePixmapData *d) : data(d), engineForReader(0), requestSize(d->requestSize), url(d->url), loading(false), redirectCount(0) { diff --git a/src/quick/util/qdeclarativepixmapcache_p.h b/src/quick/util/qdeclarativepixmapcache_p.h index 19c3a5264f..69cd84c465 100644 --- a/src/quick/util/qdeclarativepixmapcache_p.h +++ b/src/quick/util/qdeclarativepixmapcache_p.h @@ -126,6 +126,8 @@ public: bool connectDownloadProgress(QObject *, const char *); bool connectDownloadProgress(QObject *, int); + static void purgeCache(); + private: Q_DISABLE_COPY(QDeclarativePixmap) QDeclarativePixmapData *d; |