diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2012-01-09 08:54:11 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-10 09:13:11 +0100 |
commit | 58bdf5c49c1ce4229f00e8cd404381e3057b0e43 (patch) | |
tree | 8db979ceff20d61e6dc07f0068a25bbb6ab3190c /src/gui | |
parent | f85b9f824269073664770c11f58e674993d33e47 (diff) |
We should return texture id 0 for invalid images and pixmaps
in the texture cache
Change-Id: Ib9bb136fa451c571fce2adbee29998b3f3593b31
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/opengl/qopengltexturecache.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp index 4806a9d5ff..a93ae91354 100644 --- a/src/gui/opengl/qopengltexturecache.cpp +++ b/src/gui/opengl/qopengltexturecache.cpp @@ -107,6 +107,8 @@ QOpenGLTextureCache::~QOpenGLTextureCache() GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap &pixmap) { + if (pixmap.isNull()) + return 0; QMutexLocker locker(&m_mutex); qint64 key = pixmap.cacheKey(); @@ -128,6 +130,8 @@ GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QPixmap & GLuint QOpenGLTextureCache::bindTexture(QOpenGLContext *context, const QImage &image) { + if (image.isNull()) + return 0; QMutexLocker locker(&m_mutex); qint64 key = image.cacheKey(); |