summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-09-23 14:22:05 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-09-23 14:22:05 (GMT)
commit222a21187c3e3fe4ab6f436f30bde1b1dc0b2212 (patch)
tree3672e053e788e1b25852fe2e342346fb2692e49f /src/opengl
parente1c895912a89824af6b8a826b6c28865ac13b392 (diff)
downloadQt-222a21187c3e3fe4ab6f436f30bde1b1dc0b2212.zip
Qt-222a21187c3e3fe4ab6f436f30bde1b1dc0b2212.tar.gz
Qt-222a21187c3e3fe4ab6f436f30bde1b1dc0b2212.tar.bz2
Invalidate QStaticText coord cache when texture size changes
If the glyph cache texture changes size, the texture coordinate array must be regenerated to point to the correct texture locations. Reviewed-By: Gunnar Sletta
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 2347e66..0426ffd 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1470,7 +1470,7 @@ namespace {
{
public:
QOpenGLStaticTextUserData()
- : QStaticTextUserData(OpenGLUserData)
+ : QStaticTextUserData(OpenGLUserData), cacheSize(0, 0)
{
}
@@ -1478,6 +1478,7 @@ namespace {
{
}
+ QSize cacheSize;
QGL2PEXVertexArray vertexCoordinateArray;
QGL2PEXVertexArray textureCoordinateArray;
};
@@ -1542,6 +1543,12 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
// Use cache if backend optimizations is turned on
vertexCoordinates = &userData->vertexCoordinateArray;
textureCoordinates = &userData->textureCoordinateArray;
+
+ QSize size(cache->width(), cache->height());
+ if (userData->cacheSize != size) {
+ recreateVertexArrays = true;
+ userData->cacheSize = size;
+ }
}