summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-01-04 14:35:58 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2011-01-11 09:47:44 (GMT)
commit414b50fa6f436d04e5d709d337c04a380662bf40 (patch)
tree5d43957e7358f2cd9e5f7bc6eb618f525c528d59 /src
parent9179d3f6910283758147bc62f156829f72ae0a9d (diff)
downloadQt-414b50fa6f436d04e5d709d337c04a380662bf40.zip
Qt-414b50fa6f436d04e5d709d337c04a380662bf40.tar.gz
Qt-414b50fa6f436d04e5d709d337c04a380662bf40.tar.bz2
Fix regression in text rendering in OpenGL2 engine
Change 532115bcaa370af827a5cbad017b272842c5aacf introduced a regression by fixing a typo in the QT_OPENGL_ES_2 macro. This caused a broken and untested code path to be used in the GLES2 case. Since the QImage scanlines are 32 bit aligned, QImage::width() cannot be used when copying the data. Rather than pass in bytesPerLine() to the GL function, I opted to revert to the proven behavior, where the pad bytes are never read by GL but each scanline is copied separately, to avoid further regressions on different hardware. This also seems like the more correct approach, as the pad bytes should ideally not be copied into the cache texture. Reviewed-by: Samuel (cherry picked from commit 7a54885b1df9baf793374e3cb9fdf8be93ee7c80)
Diffstat (limited to 'src')
-rw-r--r--src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
index ba311c3..3aef896 100644
--- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
+++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp
@@ -293,9 +293,6 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
if (mask.format() == QImage::Format_RGB32) {
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_BGRA, GL_UNSIGNED_BYTE, mask.bits());
} else {
-#ifdef QT_OPENGL_ES_2
- glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y, maskWidth, maskHeight, GL_ALPHA, GL_UNSIGNED_BYTE, mask.bits());
-#else
// glTexSubImage2D() might cause some garbage to appear in the texture if the mask width is
// not a multiple of four bytes. The bug appeared on a computer with 32-bit Windows Vista
// and nVidia GeForce 8500GT. GL_UNPACK_ALIGNMENT is set to four bytes, 'mask' has a
@@ -307,7 +304,6 @@ void QGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph)
for (int i = 0; i < maskHeight; ++i)
glTexSubImage2D(GL_TEXTURE_2D, 0, c.x, c.y + i, maskWidth, 1, GL_ALPHA, GL_UNSIGNED_BYTE, mask.scanLine(i));
-#endif
}
}