summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-10 17:34:44 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-10 17:34:44 (GMT)
commitc87479a37db0af3016284711c5745e38177af1c4 (patch)
treee1a8b740fac806b22783e3ce0ecb0034ddc3ef72 /src
parent8b05e2626de4d5a2dcc989c1521d387767f62388 (diff)
parentcedb5e0a5bb381ecfe5acc463d96a0c15abe474d (diff)
downloadQt-c87479a37db0af3016284711c5745e38177af1c4.zip
Qt-c87479a37db0af3016284711c5745e38177af1c4.tar.gz
Qt-c87479a37db0af3016284711c5745e38177af1c4.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Missing glyphs in GL when scaling QStaticText and QML text items
Diffstat (limited to 'src')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 7045fe9..4a64f39 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1464,6 +1464,7 @@ namespace {
QSize cacheSize;
QGL2PEXVertexArray vertexCoordinateArray;
QGL2PEXVertexArray textureCoordinateArray;
+ QFontEngineGlyphCache::Type glyphType;
};
}
@@ -1489,12 +1490,17 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
cache->setContext(ctx);
}
- if (staticTextItem->userDataNeedsUpdate)
+ if (staticTextItem->userDataNeedsUpdate) {
recreateVertexArrays = true;
- else if (staticTextItem->userData() == 0)
+ } else if (staticTextItem->userData() == 0) {
recreateVertexArrays = true;
- else if (staticTextItem->userData()->type != QStaticTextUserData::OpenGLUserData)
+ } else if (staticTextItem->userData()->type != QStaticTextUserData::OpenGLUserData) {
recreateVertexArrays = true;
+ } else {
+ QOpenGLStaticTextUserData *userData = static_cast<QOpenGLStaticTextUserData *>(staticTextItem->userData());
+ if (userData->glyphType != glyphType)
+ recreateVertexArrays = true;
+ }
// We only need to update the cache with new glyphs if we are actually going to recreate the vertex arrays.
// If the cache size has changed, we do need to regenerate the vertices, but we don't need to repopulate the
@@ -1506,8 +1512,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
// No space in cache. We need to clear the cache and try again
cache->clear();
cache->populate(staticTextItem->fontEngine(), staticTextItem->numGlyphs,
- staticTextItem->glyphs, staticTextItem->glyphPositions);
- }
+ staticTextItem->glyphs, staticTextItem->glyphPositions);
+ }
}
if (cache->width() == 0 || cache->height() == 0)
@@ -1537,6 +1543,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
userData = static_cast<QOpenGLStaticTextUserData*>(staticTextItem->userData());
}
+ userData->glyphType = glyphType;
+
// Use cache if backend optimizations is turned on
vertexCoordinates = &userData->vertexCoordinateArray;
textureCoordinates = &userData->textureCoordinateArray;