gpu: Fix wrong rect check in occlusion fallback path

We need to check that the clip is inside the opaque region, not that the
opaque region is inside the clip.

Test included, using the only not that hits the fallback path with an
opaque region smaller than its bounds.
This commit is contained in:
Benjamin Otte 2024-07-08 22:22:49 +02:00
parent 155f7cdeec
commit 1dd905d976
4 changed files with 17 additions and 1 deletions

View File

@ -3426,7 +3426,7 @@ gsk_gpu_node_processor_add_first_node (GskGpuNodeProcessor *self,
return FALSE;
gsk_gpu_node_processor_get_clip_bounds (self, &clip_bounds);
if (!gsk_rect_contains_rect (&clip_bounds, &opaque))
if (!gsk_rect_contains_rect (&opaque, &clip_bounds))
return FALSE;
gsk_gpu_render_pass_begin_op (self->frame,

View File

@ -0,0 +1,15 @@
color {
bounds: 0 0 30 30;
color: rgb(0,255,0);
}
cross-fade {
progress: 0.4;
start: color {
bounds: 0 10 30 30;
color: rgb(0,0,255);
}
end: color {
bounds: 10 0 30 30;
color: rgb(255,0,0);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

View File

@ -396,6 +396,7 @@ node_parser_tests = [
'node-names-everywhere.errors',
'node-names-everywhere.node',
'node-names-everywhere.ref.node',
'occlusion-wrong-rect-contains',
'radial-gradient.node',
'radial-gradient.ref.node',
'repeating-linear-gradient.node',