summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmapdata_p.h
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-01-29 10:39:06 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-01-29 14:29:42 (GMT)
commit9e95ce2a68ef167e17dccc5789cbf3bf74712280 (patch)
tree1fc5e33c239a32905dfd6692292e363d6783b88e /src/gui/image/qpixmapdata_p.h
parente2f9547983c15be88c0a096dd52cc7c7a0eac0c6 (diff)
downloadQt-9e95ce2a68ef167e17dccc5789cbf3bf74712280.zip
Qt-9e95ce2a68ef167e17dccc5789cbf3bf74712280.tar.gz
Qt-9e95ce2a68ef167e17dccc5789cbf3bf74712280.tar.bz2
Fix GL texture leaks when pixmaps are deleted
This fixes quite a lot of issues: * QtOpenGL only registered qpixmap destruction hooks on X11 and those only cleanup the EGL/GLX surface, not the texture object. * The QPixmap destruction hooks were only being called from the QPixmap destructor. However, this means when a QPixmap is assigned to another QPixmap, the hooks don't get called. Task-number: QTBUG-7647 Reviewed-By: Samuel Reviewed-By: Trond
Diffstat (limited to 'src/gui/image/qpixmapdata_p.h')
-rw-r--r--src/gui/image/qpixmapdata_p.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/image/qpixmapdata_p.h b/src/gui/image/qpixmapdata_p.h
index 1125515..827fa18 100644
--- a/src/gui/image/qpixmapdata_p.h
+++ b/src/gui/image/qpixmapdata_p.h
@@ -117,6 +117,14 @@ public:
inline int colorCount() const { return metric(QPaintDevice::PdmNumColors); }
inline int depth() const { return d; }
inline bool isNull() const { return is_null; }
+ inline qint64 cacheKey() const {
+ int classKey = id;
+ if (classKey >= 1024)
+ classKey = -(classKey >> 10);
+ return ((((qint64) classKey) << 56)
+ | (((qint64) ser_no) << 32)
+ | ((qint64) detach_no));
+ }
#if defined(Q_OS_SYMBIAN)
virtual void* toNativeType(NativeType type);