diff options
author | Elvis Lee <kwangwoong.lee@lge.com> | 2013-01-14 11:57:22 +0900 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-25 02:17:22 +0100 |
commit | a6faecba1a878f0a741d5015c0c116dd6891af70 (patch) | |
tree | fd5b7f5e32805b1154bfc810ac2ed38089fa0f99 /src/gui/opengl/qopengltexturecache_p.h | |
parent | c0860d26a1b87f42842faeda3e6043a775916594 (diff) |
QOpenGLTextureCache : make it possible to skip qgl_byteSwapImage
Improving performance when making texture from QImage, this commit
makes it possible to skip qgl_byteSwapImage. If gl_FragColor of fragment
shader is properly configured, qgl_byteSwapImage is not required.
Ex) gl_FragColor = texture2D(texture, textureCoord).bgra;
Change-Id: If1f2d7dc1fc1c4e583cc3f38dec95a9d29417cd2
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/gui/opengl/qopengltexturecache_p.h')
-rw-r--r-- | src/gui/opengl/qopengltexturecache_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/opengl/qopengltexturecache_p.h b/src/gui/opengl/qopengltexturecache_p.h index 2e82d5f373..d4d3f00069 100644 --- a/src/gui/opengl/qopengltexturecache_p.h +++ b/src/gui/opengl/qopengltexturecache_p.h @@ -78,7 +78,7 @@ class Q_GUI_EXPORT QOpenGLTextureCache : public QOpenGLSharedResource public: static QOpenGLTextureCache *cacheForContext(QOpenGLContext *context); - QOpenGLTextureCache(QOpenGLContext *); + QOpenGLTextureCache(QOpenGLContext *, bool useByteSwapImage = true); ~QOpenGLTextureCache(); GLuint bindTexture(QOpenGLContext *context, const QPixmap &pixmap); @@ -94,6 +94,7 @@ private: QMutex m_mutex; QCache<quint64, QOpenGLCachedTexture> m_cache; + bool m_useByteSwapImage; }; QT_END_NAMESPACE |