mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
testsuite: Add another test for pixel alignment
Tests the rounding fixes from the previous commit. I'm not disabling it on GL because it succeeds - but that is somewhat by accident I guess.
This commit is contained in:
parent
6ed4eece04
commit
9d52b4e269
45
testsuite/gsk/compare/offscreen-pixel-alignment2.node
Normal file
45
testsuite/gsk/compare/offscreen-pixel-alignment2.node
Normal file
@ -0,0 +1,45 @@
|
||||
/* generate the outline, and ensure the bounds are set */
|
||||
color {
|
||||
bounds: 0 0 15 15;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/* scale by 1.5 to get into fractional scaling mode */
|
||||
transform {
|
||||
transform: scale(1.5);
|
||||
/* Use opacity node to get an offscreen
|
||||
(also makes Cairo not round pixel values wrong) */
|
||||
child: opacity {
|
||||
opacity: 0.4;
|
||||
/* We use a container with overlapping children here
|
||||
to force the offscreen */
|
||||
child: container {
|
||||
/* This color node is not pixel-aligned with
|
||||
the pixel grid - it's at (1.5, 1.5) in pixel coords.
|
||||
|
||||
So the offscreen needs to account for this
|
||||
and ensure to grow larger than the bounds
|
||||
if it wants to keep the pixel grid.
|
||||
|
||||
We use the same color as the background above,
|
||||
so that we don't get comparison artifacts
|
||||
when blending. */
|
||||
color {
|
||||
color: black;
|
||||
bounds: 1 1 8 8;
|
||||
}
|
||||
/* This color node is aligned with the pixel grid -
|
||||
It's at (3, 3) in pixel coords.
|
||||
|
||||
But it's drawn to an offscreen first, so if the
|
||||
offscreen is not pixel-aligned, this boundary
|
||||
will be blurry.
|
||||
^^^
|
||||
THIS IS WHAT THE WHOLE TEST IS ABOUT! */
|
||||
color {
|
||||
color: red;
|
||||
bounds: 2 2 6 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
BIN
testsuite/gsk/compare/offscreen-pixel-alignment2.png
Normal file
BIN
testsuite/gsk/compare/offscreen-pixel-alignment2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 B |
@ -100,6 +100,7 @@ compare_render_tests = [
|
||||
'nested-rounded-clips',
|
||||
'offscreen-fractional-translate-nogl',
|
||||
'offscreen-pixel-alignment-nogl-nocairo',
|
||||
'offscreen-pixel-alignment2',
|
||||
'opacity_clip',
|
||||
'opacity-colormatrix-combinations',
|
||||
'opacity-overdraw',
|
||||
|
Loading…
Reference in New Issue
Block a user