diff options
author | Andy Nichols <andy.nichols@digia.com> | 2014-10-14 15:14:13 +0200 |
---|---|---|
committer | Andy Nichols <andy.nichols@digia.com> | 2014-10-21 12:11:23 +0200 |
commit | 9ab2cd2d888705dcc4d103f7782b6df64d9b6d03 (patch) | |
tree | 8529f574f19e8d8767667186d49a6af74f94907e /src/quick/items/qquickspriteengine.cpp | |
parent | f08338614578db9d98d7496b2a338d0e2dddc1bb (diff) |
QQuickSpriteEngine do not use OpenGL without checking for GLContext
In the case that QQuickSpriteEngine::assembledImage() is called when
there is no current OpenGL context, return a null QImage instead of
crashing. This is needed for the Qt Quick 2d Renderer case.
Change-Id: I75b9b1f31f05cc0800293435d660e498fecc4d20
Reviewed-by: aavit <eirik.aavitsland@digia.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/items/qquickspriteengine.cpp')
-rw-r--r-- | src/quick/items/qquickspriteengine.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp index 645830c014..c5e70c9a8b 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -381,6 +381,10 @@ QImage QQuickSpriteEngine::assembledImage() m_imageStateCount = 0; int maxSize = 0; + //If there is no current OpenGL Context + if (!QOpenGLContext::currentContext()) + return QImage(); + QOpenGLContext::currentContext()->functions()->glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize); #ifdef SPRITE_IMAGE_DEBUG qDebug() << "MAX TEXTURE SIZE" << maxSize; |