summaryrefslogtreecommitdiff
path: root/src/opengl/qglpaintdevice.cpp
diff options
context:
space:
mode:
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 f7bd2a3eff..9815add3db 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;