summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_p.h
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-07-28 13:57:36 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-07-29 10:07:16 (GMT)
commit65702aa6b44568946b8c3924a45b9362401d893c (patch)
tree6219bc42277a8ddeb2be7edd1d818179e0fd1462 /src/opengl/qgl_p.h
parent78f079016e0dd9b455d74c6a84cfbdb859fd1094 (diff)
downloadQt-65702aa6b44568946b8c3924a45b9362401d893c.zip
Qt-65702aa6b44568946b8c3924a45b9362401d893c.tar.gz
Qt-65702aa6b44568946b8c3924a45b9362401d893c.tar.bz2
Refactor texture_from_pixmap to not re-create the gl surface each bind
Make a clear seperation between the GL texture and the GLX pixmap. A GLXPixmap is valid in any GL context and thus does not need to be re-created every time the pixmap has changed. Reviewed-By: Samuel
Diffstat (limited to 'src/opengl/qgl_p.h')
-rw-r--r--src/opengl/qgl_p.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index a83cc63..f21ab93 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -241,7 +241,9 @@ public:
quint32 gpm;
int screen;
QHash<QPixmapData*, QPixmap> boundPixmaps;
- QGLTexture *bindTextureFromNativePixmap(QPixmap *pm, const qint64 key, bool internal);
+ QGLTexture *bindTextureFromNativePixmap(QPixmapData*, const qint64 key, bool canInvert);
+ static void destroyGlSurfaceForPixmap(QPixmapData*);
+ static void unbindPixmapFromTexture(QPixmapData*);
#endif
#if defined(Q_WS_MAC)
bool update;
@@ -423,7 +425,8 @@ public:
// is a current context - the context the pixmap was bound to a texture in.
// Otherwise the release doesn't do anything and you get BadDrawable errors
// when you come to delete the context.
- deleteBoundPixmap();
+ if (boundPixmap)
+ QGLContextPrivate::unbindPixmapFromTexture(boundPixmap);
#endif
glDeleteTextures(1, &id);
if (switch_context && current)
@@ -437,9 +440,9 @@ public:
bool clean;
bool yInverted; // NOTE: Y-Inverted textures are for internal use only!
#if defined(Q_WS_X11)
- Qt::HANDLE boundPixmap;
- void deleteBoundPixmap(); // in qgl_x11.cpp/qgl_x11egl.cpp
+ QPixmapData* boundPixmap;
#endif
+
};
class QGLTextureCache {