diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-10-12 13:39:52 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-10-19 12:56:38 (GMT) |
commit | 22b9079040ae0d4f35781509fa6aea7e38ac47bb (patch) | |
tree | eca3b24f135eb74d63b7dde57124baedbfdeed3e /src/gui/image/qimagepixmapcleanuphooks_p.h | |
parent | e2296ba010100d007a081e0faac8066adbeb7137 (diff) | |
download | Qt-22b9079040ae0d4f35781509fa6aea7e38ac47bb.zip Qt-22b9079040ae0d4f35781509fa6aea7e38ac47bb.tar.gz Qt-22b9079040ae0d4f35781509fa6aea7e38ac47bb.tar.bz2 |
Separate modification & destruction pixmap cleanup hooks
Before the QExplicitlySharedDataPointer change, the ref-count was 0 when
calling the cleanup hooks from ~QPixmap. That enabled the hook to figure
out if the pixmap is being modified or deleted. As the ref count is now
1 when calling the cleanup hooks in ~QPixmap, we need to seperate the
hooks.
This change should make using textre-from-pixmap faster as the EGL/glX
surface wont get re-created everytime the pixmap is modified.
Reviewed-By: Gunnar
Diffstat (limited to 'src/gui/image/qimagepixmapcleanuphooks_p.h')
-rw-r--r-- | src/gui/image/qimagepixmapcleanuphooks_p.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui/image/qimagepixmapcleanuphooks_p.h b/src/gui/image/qimagepixmapcleanuphooks_p.h index dd2d0f7..16c8974 100644 --- a/src/gui/image/qimagepixmapcleanuphooks_p.h +++ b/src/gui/image/qimagepixmapcleanuphooks_p.h @@ -70,18 +70,27 @@ public: static QImagePixmapCleanupHooks *instance(); - void addPixmapHook(_qt_pixmap_cleanup_hook_pm); + // Gets called when a pixmap is about to be modified: + void addPixmapModificationHook(_qt_pixmap_cleanup_hook_pm); + + // Gets called when a pixmap is about to be destroyed: + void addPixmapDestructionHook(_qt_pixmap_cleanup_hook_pm); + + // Gets called when an image is about to be modified or destroyed: void addImageHook(_qt_image_cleanup_hook_64); - void removePixmapHook(_qt_pixmap_cleanup_hook_pm); + void removePixmapModificationHook(_qt_pixmap_cleanup_hook_pm); + void removePixmapDestructionHook(_qt_pixmap_cleanup_hook_pm); void removeImageHook(_qt_image_cleanup_hook_64); - static void executePixmapHooks(QPixmap*); + static void executePixmapModificationHooks(QPixmap*); + static void executePixmapDestructionHooks(QPixmap*); static void executeImageHooks(qint64 key); private: QList<_qt_image_cleanup_hook_64> imageHooks; - QList<_qt_pixmap_cleanup_hook_pm> pixmapHooks; + QList<_qt_pixmap_cleanup_hook_pm> pixmapModificationHooks; + QList<_qt_pixmap_cleanup_hook_pm> pixmapDestructionHooks; }; QT_END_NAMESPACE |