summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-05-27 09:45:52 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-05-27 10:46:17 (GMT)
commit73e7d0cbed0261715f534d95f81055bf97ce4314 (patch)
treec47c09db97ea0feac9e6dad40ea2e68105abd2c2 /src/opengl/gl2paintengineex
parent855022d6108f6b3c90832e742217c50550af717d (diff)
downloadQt-73e7d0cbed0261715f534d95f81055bf97ce4314.zip
Qt-73e7d0cbed0261715f534d95f81055bf97ce4314.tar.gz
Qt-73e7d0cbed0261715f534d95f81055bf97ce4314.tar.bz2
Make WA_TranslucentBackground work on QGLWidget for X11
This patch enables QGLWidget's to have an ARGB visual on X11, alowing GL rendering on semi-transparent windows. Reviewed-By: Trond
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index aafa6de..5c8b364 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1083,6 +1083,16 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
// qDebug("You should see green now");
// sleep(5);
+ const QColor &c = d->drawable.backgroundColor();
+ glClearColor(c.redF(), c.greenF(), c.blueF(), d->drawable.format().alpha() ? c.alphaF() : 1.0);
+ if (d->drawable.context()->d_func()->clear_on_painter_begin && d->drawable.autoFillBackground()) {
+ GLbitfield clearBits = GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT;
+#ifndef QT_OPENGL_ES
+ clearBits |= GL_ACCUM_BUFFER_BIT;
+#endif
+ glClear(clearBits);
+ }
+
d->brushTextureDirty = true;
d->brushUniformsDirty = true;
d->matrixDirty = true;