summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-27 15:18:58 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:50 +0200
commitb9f6b156c65d4ab0066d9d78fe7d499f1c5c4c49 (patch)
tree2cd4dfbd1d4ff0d0d843887222599978b96898c4 /src/openvg
parent45baf4ed0b2b6c7862d4df5d8b9878cec88237f3 (diff)
Make translucent windows working properly with OpenVG.
The OpenVG engine correctly uses vgClear() to fill the surface with transparent pixels whenever the window has the WA_TranslucentBackground attribute enabled. However both scissoring and masking affects the operation of vgClear(). Drawing artifacts were previously visible due this, simply because scissoring was left enabled by the VG paint engine, and the filling with transparent pixels happens in the window surface's beginPaint() that is called between the paint engine's end() (for the previous paint) and begin() (for the next paint). Task-number: QT-4907 Reviewed-by: Jani Hautakangas (cherry picked from commit 4a1ae3d1b4e8e032b1c978fcc7e1812e37e1f047)
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpaintengine_vg.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index 1f42e02c7b..68a6a0b6bd 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -1558,6 +1558,8 @@ bool QVGPaintEngine::begin(QPaintDevice *pdev)
bool QVGPaintEngine::end()
{
+ vgSeti(VG_SCISSORING, VG_FALSE);
+ vgSeti(VG_MASKING, VG_FALSE);
return true;
}
@@ -3867,6 +3869,8 @@ void QVGPaintEngine::beginNativePainting()
#if !defined(QVG_NO_DRAW_GLYPHS)
d->setTransform(VG_MATRIX_GLYPH_USER_TO_SURFACE, d->pathTransform);
#endif
+ vgSeti(VG_SCISSORING, VG_FALSE);
+ vgSeti(VG_MASKING, VG_FALSE);
d->rawVG = true;
}
@@ -3927,6 +3931,7 @@ void QVGPaintEngine::restoreState(QPaintEngine::DirtyFlags dirty)
if ((dirty & QPaintEngine::DirtyBrushOrigin) != 0)
brushOriginChanged();
d->fillRule = 0;
+ d->clearColor = QColor();
if ((dirty & QPaintEngine::DirtyOpacity) != 0)
opacityChanged();
if ((dirty & QPaintEngine::DirtyTransform) != 0)