summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-09-29 07:03:19 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-10-06 13:39:06 (GMT)
commit9dbcdc00239abbaf899f04fc5ecc2bdb885ad08d (patch)
tree93dd8b48f01976c09f6d7b188becdf604f127443 /src/opengl
parentd846af0de2ee2b3b76f81f2c0fd3ccceb645b511 (diff)
downloadQt-9dbcdc00239abbaf899f04fc5ecc2bdb885ad08d.zip
Qt-9dbcdc00239abbaf899f04fc5ecc2bdb885ad08d.tar.gz
Qt-9dbcdc00239abbaf899f04fc5ecc2bdb885ad08d.tar.bz2
Made depth tested renderText() work after stencil clipping change.
Also we should force Raster_A8 glyph format in renderText().
Diffstat (limited to 'src/opengl')
-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)