summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-01-04 14:35:58 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2011-01-05 09:17:00 (GMT)
commit7a54885b1df9baf793374e3cb9fdf8be93ee7c80 (patch)
treebe8d551eec51af40f1c8fc0bfd0245ac2d893528 /src/opengl
parentc01231089fe396689310f56529d06ab4136296fa (diff)
downloadQt-7a54885b1df9baf793374e3cb9fdf8be93ee7c80.zip
Qt-7a54885b1df9baf793374e3cb9fdf8be93ee7c80.tar.gz
Qt-7a54885b1df9baf793374e3cb9fdf8be93ee7c80.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
Diffstat (limited to 'src/opengl')
-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 1b879c3..ad1bf31 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
}
}