summaryrefslogtreecommitdiffstats
path: root/src/openvg/qwindowsurface_vg.cpp
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-11-22 21:00:51 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-11-22 21:00:51 (GMT)
commit50465c3409d699612a59b6c1d16e3502bb3a92fd (patch)
tree7499c590db41a9accf976274c40243df9ac46377 /src/openvg/qwindowsurface_vg.cpp
parent0b8639aee92913cdfaa4386aa09dde0f5cb2eaee (diff)
downloadQt-50465c3409d699612a59b6c1d16e3502bb3a92fd.zip
Qt-50465c3409d699612a59b6c1d16e3502bb3a92fd.tar.gz
Qt-50465c3409d699612a59b6c1d16e3502bb3a92fd.tar.bz2
Support semi-transparent surfaces in the OpenVG graphics system
Task-number: QT-2026 Reviewed-by: Jason Barron
Diffstat (limited to 'src/openvg/qwindowsurface_vg.cpp')
-rw-r--r--src/openvg/qwindowsurface_vg.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/openvg/qwindowsurface_vg.cpp b/src/openvg/qwindowsurface_vg.cpp
index f8486a6..a1301e3 100644
--- a/src/openvg/qwindowsurface_vg.cpp
+++ b/src/openvg/qwindowsurface_vg.cpp
@@ -48,6 +48,7 @@
#if !defined(QT_NO_EGL)
#include <QtGui/private/qegl_p.h>
+#include <QtGui/private/qwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -71,7 +72,6 @@ QVGWindowSurface::~QVGWindowSurface()
QPaintDevice *QVGWindowSurface::paintDevice()
{
- d_ptr->beginPaint(window());
return this;
}
@@ -94,8 +94,16 @@ bool QVGWindowSurface::scroll(const QRegion &area, int dx, int dy)
void QVGWindowSurface::beginPaint(const QRegion &region)
{
- // 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<QVGPaintEngine *>
+ (d_ptr->paintEngine());
+ engine->fillRegion(region, Qt::transparent, d_ptr->surfaceSize());
+ }
}
void QVGWindowSurface::endPaint(const QRegion &region)