summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglpaintdevice.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2009-08-31 11:28:14 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2009-09-08 16:36:14 (GMT)
commitb7963df603a315136b32297b861f089c0cd49acd (patch)
tree797d95a3be461b1b76585cf67a09a02ae092f184 /src/opengl/qglpaintdevice.cpp
parent7c59abc1883a24e54ac3bb2193acc2cac5ad416a (diff)
downloadQt-b7963df603a315136b32297b861f089c0cd49acd.zip
Qt-b7963df603a315136b32297b861f089c0cd49acd.tar.gz
Qt-b7963df603a315136b32297b861f089c0cd49acd.tar.bz2
Make QGLPixelBuffer work again using new QGLPaintDevice API
Add a new QGLPBufferGLPaintDevice implementation which allows the GL engines to target QGLPixelBuffers again.
Diffstat (limited to 'src/opengl/qglpaintdevice.cpp')
-rw-r--r--src/opengl/qglpaintdevice.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/opengl/qglpaintdevice.cpp b/src/opengl/qglpaintdevice.cpp
index f7bd2a3..9815add 100644
--- a/src/opengl/qglpaintdevice.cpp
+++ b/src/opengl/qglpaintdevice.cpp
@@ -41,6 +41,7 @@
#include <private/qglpaintdevice_p.h>
#include <private/qgl_p.h>
+#include <private/qglpixelbuffer_p.h>
QGLPaintDevice::QGLPaintDevice()
: m_context(0)
@@ -85,11 +86,12 @@ void QGLPaintDevice::beginPaint()
void QGLPaintDevice::endPaint()
{
+ glFlush();
}
QColor QGLPaintDevice::backgroundColor() const
{
- return QColor();
+ return QApplication::palette().brush(QPalette::Background).color();
}
bool QGLPaintDevice::autoFillBackground() const
@@ -181,6 +183,9 @@ QGLPaintDevice* QGLPaintDevice::getDevice(QPaintDevice* pd)
Q_ASSERT(qobject_cast<QGLWidget*>(static_cast<QWidget*>(pd)));
glpd = &(static_cast<QGLWidget*>(pd)->d_func()->glDevice);
break;
+ case QInternal::Pbuffer:
+ glpd = &(static_cast<QGLPixelBuffer*>(pd)->d_func()->glDevice);
+ break;
default:
qWarning("QGLPaintDevice::getDevice() - Unknown device type %d", pd->devType());
break;