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/opengl/qgl_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/opengl/qgl_p.h')
-rw-r--r-- | src/opengl/qgl_p.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 129e7f7..9a17c67 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -498,7 +498,11 @@ public: static QGLTextureCache *instance(); static void deleteIfEmpty(); static void imageCleanupHook(qint64 cacheKey); - static void pixmapCleanupHook(QPixmap* pixmap); + static void cleanupTextures(QPixmap* pixmap); +#ifdef Q_WS_X11 + // X11 needs to catch pixmap data destruction to delete EGL/GLX pixmap surfaces + static void cleanupPixmapSurfaces(QPixmap* pixmap); +#endif private: QCache<qint64, QGLTexture> m_cache; |