summaryrefslogtreecommitdiffstats
path: root/tests/baseline/painting/scripts
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2022-03-11 14:15:44 +0100
committerEirik Aavitsland <eirik.aavitsland@qt.io>2022-03-15 12:45:46 +0100
commitf46db29d8c5185e952f4665d6d141586373d3a0f (patch)
treef45baabb1c0e48c66b7b4636cffd390c1d6f5afc /tests/baseline/painting/scripts
parent182255052966d2163cfe0e16bf267925894abac8 (diff)
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 <allan.jensen@qt.io>
Diffstat (limited to 'tests/baseline/painting/scripts')
-rw-r--r--tests/baseline/painting/scripts/cliprects.qps295
1 files changed, 294 insertions, 1 deletions
diff --git a/tests/baseline/painting/scripts/cliprects.qps b/tests/baseline/painting/scripts/cliprects.qps
index aa0367eccf..cbc2a90055 100644
--- a/tests/baseline/painting/scripts/cliprects.qps
+++ b/tests/baseline/painting/scripts/cliprects.qps
@@ -1,7 +1,7 @@
# Version: 1
# CheckVsReference: 5%
-
+save
translate 10 10
setPen NoPen
@@ -56,4 +56,297 @@ setRenderHint Antialiasing
setRenderHint SmoothPixmapTransform
repeat_block clipping
+restore
+
+# Excercise combining different clips
+
+translate 0 250
+scale 0.9 0.9
+setFont "times" 10 bold
+region_addRect dummyRegion 1000 1000 10 10
+region_addRect realRegion 20 10 60 30
+path_addRect dummyPath 1000 1000 10 10
+path_addRect realPath 20 10 60 30
+begin_block paintstuff
+fillRect 0 0 100 50 orange
+drawText 0 5 "Should be clipped"
+drawText 0 15 "Should be clipped"
+drawText 0 25 "Should be clipped"
+drawText 0 35 "Should be clipped"
+drawText 0 45 "Should be clipped"
+drawText 0 55 "Should be clipped"
+end_block
+
+translate 0 100
+
+# rect replaced by x
+save
+setClipRect 1000 1000 10 10 ReplaceClip
+setClipRect 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRect 1000 1000 10 10 ReplaceClip
+setClipRectF 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRect 1000 1000 10 10 ReplaceClip
+setClipRegion realRegion ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRect 1000 1000 10 10 ReplaceClip
+setClipPath realPath ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+# rectF replaced by x
+save
+setClipRectF 1000 1000 10 10 ReplaceClip
+setClipRect 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRectF 1000 1000 10 10 ReplaceClip
+setClipRectF 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRectF 1000 1000 10 10 ReplaceClip
+setClipRegion realRegion ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRectF 1000 1000 10 10 ReplaceClip
+setClipPath realPath ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+translate -800 100
+
+# region replaced by x
+save
+setClipRegion dummyRegion ReplaceClip
+setClipRect 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRegion dummyRegion ReplaceClip
+setClipRectF 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRegion dummyRegion ReplaceClip
+setClipRegion realRegion ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRegion dummyRegion ReplaceClip
+setClipPath realPath ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+# path replaced by x
+save
+setClipPath dummyPath ReplaceClip
+setClipRect 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipPath dummyPath ReplaceClip
+setClipRectF 20 10 60 30 ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipPath dummyPath ReplaceClip
+setClipRegion realRegion ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+save
+setClipPath dummyPath ReplaceClip
+setClipPath realPath ReplaceClip
+repeat_block paintstuff
+restore
+translate 100 0
+
+region_addRect intregion 0 10 60 30
+path_addRect intpath 0 10 60 30
+
+translate -800 100
+# rect & x
+save
+setClipRect 0 10 60 30 ReplaceClip
+translate 40 0
+setClipRect 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRect 0 10 60 30 ReplaceClip
+translate 40 0
+setClipRectF 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRect 0 10 60 30 ReplaceClip
+translate 40 0
+setClipRegion intregion IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRect 0 10 60 30 ReplaceClip
+translate 40 0
+setClipPath intpath IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+# rectF & x
+save
+setClipRectF 0 10 60 30 ReplaceClip
+translate 40 0
+setClipRect 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRectF 0 10 60 30 ReplaceClip
+translate 40 0
+setClipRectF 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRectF 0 10 60 30 ReplaceClip
+translate 40 0
+setClipRegion intregion IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRectF 0 10 60 30 ReplaceClip
+translate 40 0
+setClipPath intpath IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+translate -800 100
+
+# region & x
+save
+setClipRegion intregion ReplaceClip
+translate 40 0
+setClipRect 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRegion intregion ReplaceClip
+translate 40 0
+setClipRectF 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRegion intregion ReplaceClip
+translate 40 0
+setClipRegion intregion IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipRegion intregion ReplaceClip
+translate 40 0
+setClipPath intpath IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+# path & x
+save
+setClipPath intpath ReplaceClip
+translate 40 0
+setClipRect 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipPath intpath ReplaceClip
+translate 40 0
+setClipRectF 0 10 60 30 IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipPath intpath ReplaceClip
+translate 40 0
+setClipRegion intregion IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0
+
+save
+setClipPath intpath ReplaceClip
+translate 40 0
+setClipPath intpath IntersectClip
+translate -40 0
+repeat_block paintstuff
+restore
+translate 100 0