gsk: texture-scale nodes with non-integer bounds aren't opaque

Due to the way the intermediate offscreen gets drawn, we might end up
with seams at the edges.

And I don't think it's worth spending more time on than saying "not
opaque".

Fixes the compare-render testsuite

New testcase included.
This commit is contained in:
Benjamin Otte 2024-07-08 12:51:47 +02:00
parent 4cdf7aa65a
commit 6d564075f3
2 changed files with 10 additions and 1 deletions

View File

@ -2117,7 +2117,9 @@ gsk_texture_scale_node_new (GdkTexture *texture,
self = gsk_render_node_alloc (GSK_TEXTURE_SCALE_NODE);
node = (GskRenderNode *) self;
node->offscreen_for_opacity = FALSE;
node->fully_opaque = gdk_memory_format_alpha (gdk_texture_get_format (texture)) == GDK_MEMORY_ALPHA_OPAQUE;
node->fully_opaque = gdk_memory_format_alpha (gdk_texture_get_format (texture)) == GDK_MEMORY_ALPHA_OPAQUE &&
bounds->size.width == floor (bounds->size.width) &&
bounds->size.height == floor (bounds->size.height);
self->texture = g_object_ref (texture);
gsk_rect_init_from_rect (&node->bounds, bounds);

View File

@ -0,0 +1,7 @@
texture-scale {
bounds: 3 0 1.5 1;
}
texture-scale {
bounds: 0 3 1 1.5;
}