Inverted alpha masks have an effect on the source, even if the mask
doesn't cover the source at all - or worse, is completely clipped out.
The GL renderer handles this fine, but Cairo and Vulkan had
optimizations that got this wrong.
In particular, fix the combination of luminance and alpha. We want to do
mask = luminance * alpha
and for inverted
mask = (1.0 - luminance) * alpha
so add a test that makes sure we do that and then fix the code and
existing tests to conform to it.
Make it use an alpha value that is well defined, ie 0.4 instead of 0.5.
0.4 * 255 = 102
0.5 * 255 = 127.5
This avoids rounding issues where some math may cause the resulting
alpha value to be 127, and some other math ends up with 128.
The idea is that for a rectangle intersection, each corner of the
result is either entirely part of one original rectangle or it is
an intersection point.
By detecting those 2 cases and treating them differently, we can
simplify the code to compare rounded rectangles.
This one tests a crossfade between two non-overlapping nodes with a clip
region that covers neither of the two nodes.
This tests that renderers can deal with clip regions that doesn't
overlap nodes in a situation where they will most likely want to create
an offscreen.
As offscreens are typically clipped to the clip region, this would cause
an empty offscreen and that can cause failures.
This was an experiment where an offscreen was translated inside an
existing clip.
Because renderers try to limit offscreens to the clip rect, this is
interesting, because they might get the translation wrong.
The rounded-clip-in-clip-3d test fails in GL when
flipped. Given that it was already excluded from cairo,
and also fails cairo when flipped, give up on it for now.
The repeated tests were not careful enough to produce
the correct reference image to match what the repeat
node does.
With these changes, all cairo tests pass.
Add separate suites for running the gsk compare-render
tests with the --flip, --rotate or --repeat options.
A bunch of these fail currently, and need diagnosis.
Add options to the gsk compare-render test for
modifying the node (and do a matching change to
the reference image).
flip: negative scale flipping things horizontally
rotate: 90 degree rotation
repeat: 2x2 grid
In constrast to our other tests, these use
textures that are big enough to force slicing
with setting GSK_MAX_TEXTURE_SIZE, which we
will use in the following commits to improve
test coverage.
The GL renderer was creating sripes for nodes that were scaled in
particular ways, probably due to rounding errors.
This testsuite focuses on one of those stripes to make sure they are
gone.
This test fails if we naively create fullscale
intermediate offscreens. This was fixed in the
previous commits.
This tests the fixes in 22ba6b1f33 (for
cairo) and 3a0152b65f (for GL).