diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2010-01-04 01:15:52 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2010-01-07 10:47:23 (GMT) |
commit | 3d6c181d92bbd0bf55872992733b40e3cd6816af (patch) | |
tree | 38fec6f45fea28ebd12400588e4efa13d54050ea | |
parent | 4a21216dd19693d4dcf1353de9727553107507a2 (diff) | |
download | Qt-3d6c181d92bbd0bf55872992733b40e3cd6816af.zip Qt-3d6c181d92bbd0bf55872992733b40e3cd6816af.tar.gz Qt-3d6c181d92bbd0bf55872992733b40e3cd6816af.tar.bz2 |
Reset the OpenVG scissor after a native painting call-out
Task-number: QTBUG-7051
Reviewed-by: Daniel Pope
(cherry picked from commit fbccab463a8bd77d66adb9f96a67037f73f0019d)
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index b940e97..d7ff6a1 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -200,6 +200,7 @@ public: QRegion scissorRegion; // Currently active scissor region. bool scissorActive; // True if scissor region is active. + bool scissorDirty; // True if scissor is dirty after native painting. QPaintEngine::DirtyFlags dirty; @@ -357,6 +358,7 @@ void QVGPaintEnginePrivate::init() rawVG = false; scissorActive = false; + scissorDirty = false; dirty = 0; @@ -2086,6 +2088,7 @@ void QVGPaintEngine::updateScissor() // so there is no point doing any scissoring. vgSeti(VG_SCISSORING, VG_FALSE); d->scissorActive = false; + d->scissorDirty = false; return; } } else @@ -2103,6 +2106,7 @@ void QVGPaintEngine::updateScissor() // so there is no point doing any scissoring. vgSeti(VG_SCISSORING, VG_FALSE); d->scissorActive = false; + d->scissorDirty = false; return; } } else @@ -2112,11 +2116,12 @@ void QVGPaintEngine::updateScissor() if (region.isEmpty()) { vgSeti(VG_SCISSORING, VG_FALSE); d->scissorActive = false; + d->scissorDirty = false; return; } } - if (d->scissorActive && region == d->scissorRegion) + if (d->scissorActive && region == d->scissorRegion && !d->scissorDirty) return; QVector<QRect> rects = region.rects(); @@ -2134,6 +2139,7 @@ void QVGPaintEngine::updateScissor() vgSetiv(VG_SCISSOR_RECTS, count * 4, params.data()); vgSeti(VG_SCISSORING, VG_TRUE); + d->scissorDirty = false; d->scissorActive = true; d->scissorRegion = region; } @@ -3336,6 +3342,7 @@ void QVGPaintEngine::endNativePainting() d->brushType = (VGPaintType)0; d->clearColor = QColor(); d->fillPaint = d->brushPaint; + d->scissorDirty = true; restoreState(QPaintEngine::AllDirty); d->dirty = dirty; d->rawVG = false; @@ -3669,15 +3676,17 @@ void QVGCompositionHelper::setScissor(const QRegion& region) vgSetiv(VG_SCISSOR_RECTS, count * 4, params.data()); vgSeti(VG_SCISSORING, VG_TRUE); + d->scissorDirty = false; d->scissorActive = true; d->scissorRegion = region; } void QVGCompositionHelper::clearScissor() { - if (d->scissorActive) { + if (d->scissorActive || d->scissorDirty) { vgSeti(VG_SCISSORING, VG_FALSE); d->scissorActive = false; + d->scissorDirty = false; } } |