Debian Codegraph @

testsuite/gsk/compare/offscreen-pixel-alignment2.node

raw
1 /* generate the outline, and ensure the bounds are set */
2 color {
3 bounds: 0 0 15 15;
4 color: black;
5 }
6
7 /* scale by 1.5 to get into fractional scaling mode */
8 transform {
9 transform: scale(1.5);
10 /* Use opacity node to get an offscreen
11 (also makes Cairo not round pixel values wrong) */
12 child: opacity {
13 opacity: 0.4;
14 /* We use a container with overlapping children here
15 to force the offscreen */
16 child: container {
17 /* This color node is not pixel-aligned with
18 the pixel grid - it's at (1.5, 1.5) in pixel coords.
19
20 So the offscreen needs to account for this
21 and ensure to grow larger than the bounds
22 if it wants to keep the pixel grid.
23
24 We use the same color as the background above,
25 so that we don't get comparison artifacts
26 when blending. */
27 color {
28 color: black;
29 bounds: 1 1 8 8;
30 }
31 /* This color node is aligned with the pixel grid -
32 It's at (3, 3) in pixel coords.
33
34 But it's drawn to an offscreen first, so if the
35 offscreen is not pixel-aligned, this boundary
36 will be blurry.
37 ^^^
38 THIS IS WHAT THE WHOLE TEST IS ABOUT! */
39 color {
40 color: red;
41 bounds: 2 2 6 6;
42 }
43 }
44 }
45 }