diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-10-20 12:54:22 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-10-20 12:58:38 (GMT) |
commit | bdb67474ece69a987379411f593d0b37c1400746 (patch) | |
tree | 81238586d1ebf593f03016cb1db30f034effa44e /src/opengl/qgl_x11egl.cpp | |
parent | f0a7e831394683190faf8a51bf724462f98568e9 (diff) | |
download | Qt-bdb67474ece69a987379411f593d0b37c1400746.zip Qt-bdb67474ece69a987379411f593d0b37c1400746.tar.gz Qt-bdb67474ece69a987379411f593d0b37c1400746.tar.bz2 |
Make sure QGLTextureCache exists when creating surfaces for pixmaps
QGLTextureCache installs pixmap cleanup hooks which are used to clean up
the EGL surfaces.
Reviewed-By: Trustme
Diffstat (limited to 'src/opengl/qgl_x11egl.cpp')
-rw-r--r-- | src/opengl/qgl_x11egl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp index fb08741..3894ed1 100644 --- a/src/opengl/qgl_x11egl.cpp +++ b/src/opengl/qgl_x11egl.cpp @@ -521,6 +521,14 @@ bool Q_OPENGL_EXPORT qt_createEGLSurfaceForPixmap(QPixmapData* pmd, bool readOnl return false; } + static bool doneOnce = false; + if (!doneOnce) { + // Make sure QGLTextureCache is instanciated so it can install cleanup hooks + // which cleanup the EGL surface. + QGLTextureCache::instance(); + doneOnce = true; + } + Q_ASSERT(sizeof(Qt::HANDLE) >= sizeof(EGLSurface)); // Just to make totally sure! pixmapData->gl_surface = (Qt::HANDLE)pixmapSurface; pixmapData->is_cached = true; // Make sure the cleanup hook gets called |