summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-02 14:36:55 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-02-02 14:36:55 (GMT)
commit8aa94f13be95392d0bba911105bb118b48321a15 (patch)
treec247d03420a11e218b85b002d899ac292b5a9bbd /src
parentc265f7ac9a7a2344cc441a474c76e2ecf36bafbf (diff)
downloadQt-8aa94f13be95392d0bba911105bb118b48321a15.zip
Qt-8aa94f13be95392d0bba911105bb118b48321a15.tar.gz
Qt-8aa94f13be95392d0bba911105bb118b48321a15.tar.bz2
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.)
Diffstat (limited to 'src')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp6
1 files 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<GLubyte> indices;
+ QVector<GLuint> indices;
#endif
};
}
@@ -1339,7 +1339,7 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp
GLfloat dy = 1.0 / cache->height();
#if defined(QSTATICTEXT_USE_INDEXARRAY)
- QVector<GLubyte> indices;
+ QVector<GLuint> 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