mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
vulkan: Handle empty child bounds in repeat node
Also add test to the testsuite for it.
This commit is contained in:
parent
da147dca92
commit
7f1bd1f047
@ -209,6 +209,8 @@ gsk_vulkan_image_new (GdkVulkanContext *context,
|
||||
VkMemoryRequirements requirements;
|
||||
GskVulkanImage *self;
|
||||
|
||||
g_assert (width > 0 && height > 0);
|
||||
|
||||
self = g_object_new (GSK_TYPE_VULKAN_IMAGE, NULL);
|
||||
|
||||
self->vulkan = g_object_ref (context);
|
||||
|
@ -725,6 +725,9 @@ gsk_vulkan_render_pass_add_repeat_node (GskVulkanRenderPass *self,
|
||||
.render.node = node
|
||||
};
|
||||
|
||||
if (graphene_rect_get_area (gsk_repeat_node_get_child_bounds (node)) == 0)
|
||||
return TRUE;
|
||||
|
||||
if (gsk_vulkan_clip_contains_rect (&constants->clip, &node->bounds))
|
||||
pipeline_type = GSK_VULKAN_PIPELINE_TEXTURE;
|
||||
else if (constants->clip.type == GSK_VULKAN_CLIP_RECT)
|
||||
|
24
testsuite/gsk/compare/repeat-empty-child-bounds.node
Normal file
24
testsuite/gsk/compare/repeat-empty-child-bounds.node
Normal file
@ -0,0 +1,24 @@
|
||||
repeat {
|
||||
bounds: 0 0 100 100;
|
||||
child-bounds: 0 0 0 0;
|
||||
child: color {
|
||||
bounds: 0 0 20 20;
|
||||
color: rgb(255,0,0);
|
||||
}
|
||||
}
|
||||
repeat {
|
||||
bounds: 0 0 100 100;
|
||||
child-bounds: 0 0 20 0;
|
||||
child: color {
|
||||
bounds: 0 0 20 20;
|
||||
color: rgb(0,128,0);
|
||||
}
|
||||
}
|
||||
repeat {
|
||||
bounds: 0 0 100 100;
|
||||
child-bounds: 0 0 0 20;
|
||||
child: color {
|
||||
bounds: 0 0 20 20;
|
||||
color: rgb(0,0,255);
|
||||
}
|
||||
}
|
BIN
testsuite/gsk/compare/repeat-empty-child-bounds.png
Normal file
BIN
testsuite/gsk/compare/repeat-empty-child-bounds.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 119 B |
@ -77,6 +77,7 @@ compare_render_tests = [
|
||||
'outset_shadow_simple',
|
||||
'repeat',
|
||||
'repeat-no-repeat',
|
||||
'repeat-empty-child-bounds',
|
||||
'repeat-negative-coords',
|
||||
'repeat-texture',
|
||||
'scale-textures-negative-ngl',
|
||||
|
Loading…
Reference in New Issue
Block a user