qt5base-lts/tests/baseline/painting/scripts/pattern_xform2.qps
Eirik Aavitsland f67d89ebde Support cosmetic brush patterns in the pdf and opengl paint engines
This implements the recent functionality extension of painting
cosmetic (untransformed) brush patterns, and the corresponding
NonCosmeticBrushPatterns render hint, in the pdf and opengl paint
engines.

As part of the implementation it also fixes a couple of pre-existing
bugs in the opengl engine, relating to updating the brush after
changes in transformation or brush origin.

As a driveby, it also includes a minor fix for the lance testing tool:
request stencil buffer, as that is needed and not always provided by
default. This echoes a recent fix done to tst_baseline_painting.

Change-Id: Ia8811477e015eebeb40ed138bca96643ce1ab0dc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-06-04 21:15:42 +02:00

82 lines
1.5 KiB
Plaintext

# Version: 1
# CheckVsReference: 5%
# 1: Check brush origin vs (non)cosmetic brush patterns
setBrush blue CrossPattern
begin_block blockName
save
setBrushOrigin 0 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 1 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 2 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 3 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 4 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 5 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 6 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 7 0
fillRect 0 0 32 32
translate 0 32
setBrushOrigin 8 0
fillRect 0 0 32 32
restore
end_block blockName
save
setBrush red CrossPattern
scale 2 1
repeat_block blockName
restore
save
translate 0 300
setRenderHint NonCosmeticBrushPatterns true
setBrush blue CrossPattern
repeat_block blockName
setBrush red CrossPattern
scale 2 1
repeat_block blockName
restore
# 2: Check brush update after only xform or hint change
translate 100 0
save
setPen NoPen
setBrush blue DiagCrossPattern
setRenderHint NonCosmeticBrushPatterns true
drawRect 10 10 200 100
scale 10 10
drawRect 22 1 20 10
drawRect 22 12 20 10
setRenderHint NonCosmeticBrushPatterns false
drawRect 1 12 20 10
restore
setBrush green DiagCrossPattern
setPen brush 100 SolidLine FlatCap
pen_setCosmetic true
setBrush NoBrush
translate 0 250
setRenderHint NonCosmeticBrushPatterns true
drawLine 10 60 210 60
scale 10 10
drawLine 22 6 42 6
drawLine 22 17 42 17
setRenderHint NonCosmeticBrushPatterns false
drawLine 1 17 21 17