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>bb10
parent
f85b9f8242
commit
58bdf5c49c
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue