summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-03-16 16:25:47 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-03-16 16:25:47 (GMT)
commit580e3d9968e12fb38348af503ef9ede50691c24c (patch)
tree2ae55db9989bd8147de9d25071cecbd279b847d7 /src/opengl/qgl.cpp
parente318b0276c3d4a0db8660b4fa6d68f1784aee522 (diff)
parentb8ded0df9c85558b93ee5ec5abd5774c87c4deed (diff)
downloadQt-580e3d9968e12fb38348af503ef9ede50691c24c.zip
Qt-580e3d9968e12fb38348af503ef9ede50691c24c.tar.gz
Qt-580e3d9968e12fb38348af503ef9ede50691c24c.tar.bz2
Merge remote-tracking branch 'origin/4.7' into HEAD
Conflicts: configure mkspecs/symbian-gcce/qmake.conf qmake/generators/metamakefile.cpp qmake/generators/win32/mingw_make.cpp src/corelib/global/global.pri src/corelib/global/qglobal.h src/opengl/qgl.cpp src/opengl/qwindowsurface_gl.cpp src/plugins/platforms/wayland/qwaylandbuffer.h tests/auto/qnetworkreply/tst_qnetworkreply.cpp tools/designer/src/components/formeditor/qdesigner_resource.cpp
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 76621e9..a769f2c 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -100,6 +100,9 @@
#ifdef QT_OPENGL_ES
#include <EGL/egl.h>
#endif
+#ifdef QGL_USE_TEXTURE_POOL
+#include <private/qgltexturepool_p.h>
+#endif
// #define QT_GL_CONTEXT_RESOURCE_DEBUG
@@ -2033,6 +2036,10 @@ struct DDSFormat {
the pixmap/image that it stems from, e.g. installing destruction
hooks in them.
+ \omitvalue TemporarilyCachedBindOption Used by paint engines on some
+ platforms to indicate that the pixmap or image texture is possibly
+ cached only temporarily and must be destroyed immediately after the use.
+
\omitvalue InternalBindOption
*/
@@ -2537,8 +2544,18 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G
#endif
const QImage &constRef = img; // to avoid detach in bits()...
+#ifdef QGL_USE_TEXTURE_POOL
+ QGLTexturePool::instance()->createPermanentTexture(tx_id,
+ target,
+ 0, internalFormat,
+ img.width(), img.height(),
+ externalFormat,
+ pixel_type,
+ constRef.bits());
+#else
glTexImage2D(target, 0, internalFormat, img.width(), img.height(), 0, externalFormat,
pixel_type, constRef.bits());
+#endif
#if defined(QT_OPENGL_ES_2)
if (genMipmap)
glGenerateMipmap(target);
@@ -2577,7 +2594,6 @@ QGLTexture *QGLContextPrivate::textureCacheLookup(const qint64 key, GLenum targe
return 0;
}
-
/*! \internal */
QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, GLint format, QGLContext::BindOptions options)
{