summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-07-05 08:33:59 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-07-05 09:39:13 (GMT)
commitf51b5fe09c63e4b3c2ab5a4d06e162c43d38207d (patch)
tree631f8a4d2fee733362d67281edf3d7a4026370e1 /src/opengl
parentdf48d66d6e0af1281e1909b47054d45c729b675e (diff)
downloadQt-f51b5fe09c63e4b3c2ab5a4d06e162c43d38207d.zip
Qt-f51b5fe09c63e4b3c2ab5a4d06e162c43d38207d.tar.gz
Qt-f51b5fe09c63e4b3c2ab5a4d06e162c43d38207d.tar.bz2
Don't issue GL calls when the geometry is empty
This works as a band-aid and optimization for QT-5104, because in the text in the example, which contains latin text and has a latin default font set, will think of all spaces between the cyrillic characters as latin characters, hence it will make separate text items for them and issue separate glDrawElements() calls. By cutting off if there are no glyphs to draw, we can avoid hitting the actual bug for this and several other use cases, making it less likely to happen. Task-number: QT-5104 Reviewed-by: Samuel
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 52450b6..5d2221f 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1696,6 +1696,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
}
int numGlyphs = vertexCoordinates->vertexCount() / 4;
+ if (numGlyphs == 0)
+ return;
if (elementIndices.size() < numGlyphs*6) {
Q_ASSERT(elementIndices.size() % 6 == 0);