testsuite: Add a test for subpixel positioning

Draw a grid of 21x21 box glyphs.

Each glyph is offset by n/20 pixels in the x and y direction.

The background color is carefully selected to be divisible by 16, so
that when the box glyph is subpixel positioned by 1/4th of a pixel
offset from the pixel grid in either direction, the result will be an
edge pixel whose color value can be computed exactly.

Cairo still rounds this wrong for color values >= 128 which is why we
use a dark gray that guarantees the resulting color values are all <128.
This commit is contained in:
Benjamin Otte 2024-01-22 12:02:28 +01:00
parent c31b6ff1d5
commit fff912efd3
3 changed files with 2665 additions and 0 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

View File

@ -141,6 +141,7 @@ compare_render_tests = [
'stroke-fractional-translate-nogl',
'stroke-opacity',
'stroke-with-3d-contents-nogl-nocairo',
'subpixel-positioning',
'text-color-mix',
'text-glyph-lsb',
'text-mixed-color-nocairo',