forked from hexagon-geo-surv/qtbase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add painter render hint for brush pattern transformation
[ChangeLog][QtGui][QPainter] In Qt 5, the predefined brush patterns would always be transformed along with the object being painted. In Qt 6.0 onwards, they would or would not, depending on the SmoothPixmapTransformation render hint. Instead of this somewhat surprising behavior, make the default be untransformed (i.e. cosmetic), which makes sense when it comes to dpr scaling. For the cases where one wants scaling, a new render hint is introduced to enable that: NonCosmeticPatternBrushes. Change-Id: I2208c7a28af9056d7ab97a529b66bf2d502c3c4f Reviewed-by: Allan Sandfeld Jensen <[email protected]>
- Loading branch information
Showing
10 changed files
with
134 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Version: 1 | ||
# CheckVsReference: 5% | ||
|
||
#define basic block off screen | ||
save | ||
translate -1000 -1000 | ||
begin_block drawrects | ||
setBrush green Dense4Pattern | ||
drawRect 0 0 40 40 | ||
setBrush green DiagCrossPattern | ||
drawRect 40 0 40 40 | ||
setBrush green VerPattern | ||
brushRotate 30 | ||
drawRect 80 0 40 40 | ||
save | ||
setPen brush 40 SolidLine FlatCap | ||
setBrush NoBrush | ||
drawLine 120 20 160 20 | ||
restore | ||
end_block | ||
restore | ||
|
||
begin_block hintsuite | ||
save | ||
setRenderHint NonCosmeticBrushPatterns false | ||
setRenderHint SmoothPixmapTransform false | ||
translate 10 10 | ||
repeat_block drawrects | ||
|
||
setRenderHint NonCosmeticBrushPatterns false | ||
setRenderHint SmoothPixmapTransform true | ||
translate 0 50 | ||
repeat_block drawrects | ||
|
||
setRenderHint NonCosmeticBrushPatterns true | ||
setRenderHint SmoothPixmapTransform false | ||
translate 0 50 | ||
repeat_block drawrects | ||
|
||
setRenderHint NonCosmeticBrushPatterns true | ||
setRenderHint SmoothPixmapTransform true | ||
translate 0 50 | ||
repeat_block drawrects | ||
restore | ||
end_block | ||
|
||
save | ||
translate 0 200 | ||
scale 2 2 | ||
repeat_block hintsuite | ||
restore | ||
|
||
save | ||
translate 500 0 | ||
scale 1.5 2.5 | ||
rotate_y 60 | ||
repeat_block hintsuite | ||
restore | ||
|
||
|
||
translate 0 650 | ||
setBrush blue CrossPattern | ||
setPen red | ||
setRenderHint NonCosmeticBrushPatterns false | ||
|
||
begin_block dots | ||
save | ||
drawRect 0 0 50 50 | ||
setBrushOrigin 12 0 | ||
drawRect 50 0 50 50 | ||
scale 2 1 | ||
drawRect 50 0 50 50 | ||
restore | ||
end_block dots | ||
|
||
setRenderHint NonCosmeticBrushPatterns true | ||
translate 0 60 | ||
repeat_block dots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters