diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-04-11 17:28:52 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-18 07:39:25 +0200 |
commit | dc051f28b865e54d3834824ffea6f2562f0836c1 (patch) | |
tree | d70cde4e23112ccc256a62408d5e29829452e6e6 /src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp | |
parent | 2776d48b7a1586518e9add43f723ecc6987f4418 (diff) |
Make sure the clipPath is retained as state of Context2D
The W3C spec doesn't say anything about the clip path getting reset
automatically at any point and so I guess we should retain it. This of
course is terribly annoying if the canvas element gets resized and ends
up with a default clipPath that doesn't match the canvas anymore. You
basically have to call reset() in every onPaint now. However, this just
highlights a general problem with stateful canvas contexts and we cannot
ignore user defined clipPaths like this.
Task-number: QTBUG-38297
Change-Id: I233226af6458298ef3d752d08ecdebebae2e0a8f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp')
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp index 06a0713365..5697c25ff0 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp @@ -214,6 +214,8 @@ void QQuickContext2DCommandBuffer::setPainterState(QPainter* p, const QQuickCont if (state.globalCompositeOperation != p->compositionMode()) p->setCompositionMode(state.globalCompositeOperation); + + p->setClipPath(state.clipPath); } static void qt_drawImage(QPainter *p, QQuickContext2D::State& state, QImage image, const QRectF& sr, const QRectF& dr, bool shadow = false) |