summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-29 07:03:19 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-10-07 02:59:32 (GMT)
commit0926616ab27b82a16dc05e92fbe81b545dce33b5 (patch)
tree7d96c2299a5c1aeba6bdc217faaa8f070a642e97
parent2ec1b27e49638d494d1a0bb5983a64d05eebb64a (diff)
downloadQt-0926616ab27b82a16dc05e92fbe81b545dce33b5.zip
Qt-0926616ab27b82a16dc05e92fbe81b545dce33b5.tar.gz
Qt-0926616ab27b82a16dc05e92fbe81b545dce33b5.tar.bz2
Made depth tested renderText() work after stencil clipping change.
Also we should force Raster_A8 glyph format in renderText(). (cherry picked from commit 9dbcdc00239abbaf899f04fc5ecc2bdb885ad08d)
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 70d1ae9..ab38c24 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -912,13 +912,6 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path)
void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& vertexArray, bool useWindingFill)
{
-#ifndef QT_OPENGL_ES_2
- if (inRenderText) {
- glPushAttrib(GL_ENABLE_BIT);
- glDisable(GL_DEPTH_TEST);
- }
-#endif
-
// qDebug("QGL2PaintEngineExPrivate::fillStencilWithVertexArray()");
glStencilMask(0xffff); // Enable stencil writes
@@ -943,6 +936,13 @@ void QGL2PaintEngineExPrivate::fillStencilWithVertexArray(QGL2PEXVertexArray& ve
useSimpleShader();
glEnable(GL_STENCIL_TEST); // For some reason, this has to happen _after_ the simple shader is use()'d
+#ifndef QT_OPENGL_ES_2
+ if (inRenderText) {
+ glPushAttrib(GL_ENABLE_BIT);
+ glDisable(GL_DEPTH_TEST);
+ }
+#endif
+
if (useWindingFill) {
if (q->state()->clipTestEnabled) {
glStencilFunc(GL_LEQUAL, GL_STENCIL_HIGH_BIT | q->state()->currentClip, ~GL_STENCIL_HIGH_BIT);
@@ -1331,6 +1331,9 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
? QFontEngineGlyphCache::Type(ti.fontEngine->glyphFormat)
: d->glyphCacheType;
+ if (d->inRenderText)
+ glyphType = QFontEngineGlyphCache::Raster_A8;
+
if (glyphType == QFontEngineGlyphCache::Raster_RGBMask
&& state()->composition_mode != QPainter::CompositionMode_Source
&& state()->composition_mode != QPainter::CompositionMode_SourceOver)