diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-04-27 09:16:10 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2010-04-27 11:45:59 (GMT) |
commit | 939fdb8f03b998996e532cb89c8e522565c1aecc (patch) | |
tree | 0565fdf1f64b6bef2366039832a83863431ba456 /src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | |
parent | 62f952daa97d7a85d62f839bef2a3d015e7bb9e0 (diff) | |
download | Qt-939fdb8f03b998996e532cb89c8e522565c1aecc.zip Qt-939fdb8f03b998996e532cb89c8e522565c1aecc.tar.gz Qt-939fdb8f03b998996e532cb89c8e522565c1aecc.tar.bz2 |
Fix crash when using opengl graphicssystem on desktop
Reviewed-By: Eskil
Task-number: QTBUG-10225
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 8460430..4461358 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1337,9 +1337,12 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem) d->drawCachedGlyphs(glyphType, textItem, true); } -void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src) +bool QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src) { Q_D(QGL2PaintEngineEx); + if (!d->shaderManager) + return false; + ensureActive(); d->transferMode(ImageDrawingMode); @@ -1354,6 +1357,7 @@ void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const d->updateTextureFilter(GL_TEXTURE_2D, GL_CLAMP_TO_EDGE, state()->renderHints & QPainter::SmoothPixmapTransform, textureId); d->drawTexture(dest, srcRect, size, false); + return true; } void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem) |