diff -r 56cd8111b7f7 -r 41300fa6a67c src/openvg/qwindowsurface_vg.cpp --- a/src/openvg/qwindowsurface_vg.cpp Tue Jan 26 12:42:25 2010 +0200 +++ b/src/openvg/qwindowsurface_vg.cpp Tue Feb 02 00:43:10 2010 +0200 @@ -48,14 +48,15 @@ #if !defined(QT_NO_EGL) #include +#include QT_BEGIN_NAMESPACE QVGWindowSurface::QVGWindowSurface(QWidget *window) : QWindowSurface(window) { - d_ptr = QVGEGLWindowSurfacePrivate::create - (QVGEGLWindowSurfacePrivate::WindowSurface, this); + // Create the default type of EGL window surface for windows. + d_ptr = new QVGEGLWindowSurfaceDirect(this); } QVGWindowSurface::QVGWindowSurface @@ -71,7 +72,6 @@ QPaintDevice *QVGWindowSurface::paintDevice() { - d_ptr->beginPaint(window()); return this; } @@ -94,8 +94,16 @@ void QVGWindowSurface::beginPaint(const QRegion ®ion) { - // Nothing to do here. - Q_UNUSED(region); + d_ptr->beginPaint(window()); + + // If the window is not opaque, then fill the region we are about + // to paint with the transparent color. + if (!qt_widget_private(window())->isOpaque && + window()->testAttribute(Qt::WA_TranslucentBackground)) { + QVGPaintEngine *engine = static_cast + (d_ptr->paintEngine()); + engine->fillRegion(region, Qt::transparent, d_ptr->surfaceSize()); + } } void QVGWindowSurface::endPaint(const QRegion ®ion)