diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-02-12 09:41:50 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-02-12 11:55:06 (GMT) |
commit | 95b320c17f4a0a505dd9da2362b0b7cc09ac64d8 (patch) | |
tree | 6537771b39a7cd78dc1ce75d9e7157f44d00c4d8 /src/gui | |
parent | f42ad9029816891fd5c603b0fa6259e758db0e07 (diff) | |
download | Qt-95b320c17f4a0a505dd9da2362b0b7cc09ac64d8.zip Qt-95b320c17f4a0a505dd9da2362b0b7cc09ac64d8.tar.gz Qt-95b320c17f4a0a505dd9da2362b0b7cc09ac64d8.tar.bz2 |
Fix several bugs with GL texture cache
Reviewed-By: Trond
Autotest: tst_QGL::qglContextDefaultBindTexture
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/image/qimagepixmapcleanuphooks.cpp | 21 | ||||
-rw-r--r-- | src/gui/image/qimagepixmapcleanuphooks_p.h | 3 |
2 files changed, 20 insertions, 4 deletions
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp index ace4bb6..517fcb0 100644 --- a/src/gui/image/qimagepixmapcleanuphooks.cpp +++ b/src/gui/image/qimagepixmapcleanuphooks.cpp @@ -122,19 +122,32 @@ void QImagePixmapCleanupHooks::executeImageHooks(qint64 key) qt_image_cleanup_hook_64(key); } -void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) -{ - enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); -} void QImagePixmapCleanupHooks::enableCleanupHooks(QPixmapData *pixmapData) { pixmapData->is_cached = true; } +void QImagePixmapCleanupHooks::enableCleanupHooks(const QPixmap &pixmap) +{ + enableCleanupHooks(const_cast<QPixmap &>(pixmap).data_ptr().data()); +} + void QImagePixmapCleanupHooks::enableCleanupHooks(const QImage &image) { const_cast<QImage &>(image).data_ptr()->is_cached = true; } +bool QImagePixmapCleanupHooks::isImageCached(const QImage &image) +{ + return const_cast<QImage &>(image).data_ptr()->is_cached; +} + +bool QImagePixmapCleanupHooks::isPixmapCached(const QPixmap &pixmap) +{ + return const_cast<QPixmap&>(pixmap).data_ptr().data()->is_cached; +} + + + QT_END_NAMESPACE diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h index 88dd3a6..eae11f4 100644 --- a/src/gui/image/qimagepixmapcleanuphooks_p.h +++ b/src/gui/image/qimagepixmapcleanuphooks_p.h @@ -72,6 +72,9 @@ public: static void enableCleanupHooks(const QPixmap &pixmap); static void enableCleanupHooks(QPixmapData *pixmapData); + static bool isImageCached(const QImage &image); + static bool isPixmapCached(const QPixmap &pixmap); + // Gets called when a pixmap data is about to be modified: void addPixmapDataModificationHook(_qt_pixmap_cleanup_hook_pmd); |