mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 16:30:15 +00:00
snapshot: Use a better placeholder
An empty container has the same effect as transparency with the cairo renderer, but creates black with Vulkan. To avoid this, explicitly use a transparent color node. This fixes the css blendmode example in gtk4-demo with the Vulkan renderer.
This commit is contained in:
parent
e3f5a8bd47
commit
672fb60879
@ -746,15 +746,18 @@ gtk_snapshot_collect_blend_top (GtkSnapshot *snapshot,
|
||||
const char *name)
|
||||
{
|
||||
GskRenderNode *bottom_node, *top_node, *blend_node;
|
||||
GdkRGBA transparent = { 0, 0, 0, 0 };
|
||||
|
||||
top_node = gtk_snapshot_collect_default (snapshot, state, nodes, n_nodes, name);
|
||||
bottom_node = state->data.blend.bottom_node;
|
||||
|
||||
g_assert (top_node != NULL || bottom_node != NULL);
|
||||
|
||||
/* XXX: Is this necessary? Do we need a NULL node? */
|
||||
if (top_node == NULL)
|
||||
top_node = gsk_container_node_new (NULL, 0);
|
||||
top_node = gsk_color_node_new (&transparent, &bottom_node->bounds);
|
||||
if (bottom_node == NULL)
|
||||
bottom_node = gsk_container_node_new (NULL, 0);
|
||||
bottom_node = gsk_color_node_new (&transparent, &top_node->bounds);
|
||||
|
||||
blend_node = gsk_blend_node_new (bottom_node, top_node, state->data.blend.blend_mode);
|
||||
gsk_render_node_set_name (blend_node, name);
|
||||
|
Loading…
Reference in New Issue
Block a user