From f46db29d8c5185e952f4665d6d141586373d3a0f Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Fri, 11 Mar 2022 14:15:44 +0100 Subject: Painting: fix overriding and combining different clip types In a recent improvement (6de36918c03e91933fbfb5bf7b53abbe03edf460) the last set clip region or path was stored in separate variables, in order to be set again if the aliasing mode changed. That solution was too simplistic, as it would break down as soon as more than one clip area was set, with the latter either replacing or intersecting the first. It was also unnecessary to introduce new storing of clip areas and transforms, as those are already recorded in the clipInfo stack in the painter state. This patch hence reverts much of that implementation. However the basic idea of setting the clip area again after AA change is good, so that part is kept, implementated instead by calling a pre-existing function to replay the clipInfo stack. One of the baseline test cases is extended to excercise the combination of clip areas. As a driveby, support for setClipRectF is added to the painting baseline test scripts, and the build of the manual lance tool is fixed. Fixes: QTBUG-101474 Pick-to: 6.3 6.2 Change-Id: Ide8b70d8cbf138deb06cbb84f69e62f7405886e6 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qpainter.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/gui/painting/qpainter.cpp') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 704b841b15..5883cc5bbe 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2848,7 +2848,6 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) d->state->clipInfo.clear(); d->state->clipInfo.append(QPainterClipInfo(r, op, d->state->matrix)); d->state->clipOperation = op; - d->state->clipRegion = r; return; } @@ -3063,7 +3062,6 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) d->state->clipInfo.clear(); d->state->clipInfo.append(QPainterClipInfo(path, op, d->state->matrix)); d->state->clipOperation = op; - d->state->clipPath = path; return; } -- cgit v1.2.3