diff options
author | Tor Arne Vestbø <torarnv@gmail.com> | 2014-02-24 11:34:20 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-24 12:08:08 +0100 |
commit | aac68a9ef36f75d23877d6ce27b6392612900756 (patch) | |
tree | 61c71358229ba0c4a2ea5e8eed4bcd564da53f05 /src/opengl/gl2paintengineex | |
parent | 74d4fcea4a83933f9f2fcc9ff6a54f1c1e59382e (diff) |
Fix texture glyph cache setup in old OpenGL paint engine
Caused assert-crash reported on Windows.
Task-number: QTBUG-37027
Change-Id: If84b970a153570115afb344797728a0b1a04db5b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index ec4ff5a2b2..b8c039d0e2 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1482,9 +1482,10 @@ void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem) // don't try to cache huge fonts or vastly transformed fonts QFontEngine *fontEngine = textItem->fontEngine(); if (shouldDrawCachedGlyphs(fontEngine, s->matrix)) { - QFontEngine::GlyphFormat glyphFormat = fontEngine->glyphFormat >= 0 - ? QFontEngine::GlyphFormat(textItem->fontEngine()->glyphFormat) - : d->glyphCacheFormat; + + QFontEngine::GlyphFormat glyphFormat = fontEngine->glyphFormat != QFontEngine::Format_None + ? fontEngine->glyphFormat : d->glyphCacheFormat; + if (glyphFormat == QFontEngine::Format_A32) { if (!QGLFramebufferObject::hasOpenGLFramebufferObjects() || d->device->alphaRequested() || s->matrix.type() > QTransform::TxTranslate @@ -1532,10 +1533,8 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem QTransform::TransformationType txtype = s->matrix.type(); - QFontEngine::GlyphFormat glyphFormat = ti.fontEngine->glyphFormat >= 0 - ? ti.fontEngine->glyphFormat - : d->glyphCacheFormat; - + QFontEngine::GlyphFormat glyphFormat = ti.fontEngine->glyphFormat != QFontEngine::Format_None + ? ti.fontEngine->glyphFormat : d->glyphCacheFormat; if (glyphFormat == QFontEngine::Format_A32) { if (!QGLFramebufferObject::hasOpenGLFramebufferObjects() |