rendernode: Shadow nodes need offscreen for opacity

Otherwise the shadow will not be properly computed as opaque regions
become translucent after applying opacity.

Testcase included.
This commit is contained in:
Benjamin Otte 2023-09-07 22:57:57 +02:00
parent 55ae8dc39e
commit f8627755b5
4 changed files with 12 additions and 1 deletions

View File

@ -5013,7 +5013,7 @@ gsk_shadow_node_new (GskRenderNode *child,
self = gsk_render_node_alloc (GSK_SHADOW_NODE);
node = (GskRenderNode *) self;
node->offscreen_for_opacity = child->offscreen_for_opacity;
node->offscreen_for_opacity = TRUE;
self->child = gsk_render_node_ref (child);
self->n_shadows = n_shadows;

View File

@ -0,0 +1,10 @@
opacity {
opacity: 0.6;
child: shadow {
shadows: rgb(255,0,0) 10 10;
child: color {
bounds: 0 0 50 50;
color: rgb(0,0,255);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

View File

@ -92,6 +92,7 @@ compare_render_tests = [
'scaled-cairo',
'scaled-texture',
'shadow-in-opacity',
'shadow-opacity',
'stroke',
'texture-scale-magnify-10000x',
'texture-scale-magnify-rotate',