From 8aa94f13be95392d0bba911105bb118b48321a15 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 2 Feb 2010 15:36:55 +0100 Subject: Fix broken text drawing in OpenGL engine when text items are too long Passing text through drawElements introduced a bug when text items exceeded the range of GLubyte (seen in textedit demo.) --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 878faf4..d82d335 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1300,7 +1300,7 @@ namespace { GLuint textureCoordVBOId; #if defined(QSTATICTEXT_USE_INDEXARRAY) - QVector indices; + QVector indices; #endif }; } @@ -1339,7 +1339,7 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp GLfloat dy = 1.0 / cache->height(); #if defined(QSTATICTEXT_USE_INDEXARRAY) - QVector indices; + QVector indices; #endif if (staticTextItem->userData == 0 @@ -1519,7 +1519,7 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::MaskTexture), QT_MASK_TEXTURE_UNIT); #if defined(QSTATICTEXT_USE_INDEXARRAY) - glDrawElements(GL_TRIANGLES, 6 * staticTextItem->numGlyphs, GL_UNSIGNED_BYTE, indices.constData()); + glDrawElements(GL_TRIANGLES, 6 * staticTextItem->numGlyphs, GL_UNSIGNED_INT, indices.constData()); #else glDrawArrays(GL_TRIANGLES, 0, 6 * staticTextItem->numGlyphs); #endif -- cgit v0.12