mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
vulkan: Change the clip intersection check
Intersection with a roudned clip takes too long. Instead, rename the function to may_intersect() to be clear about what it does and then just intersect with the regular rectangle.
This commit is contained in:
parent
5c601b673e
commit
3523d56122
@ -236,9 +236,9 @@ gsk_vulkan_clip_transform (GskVulkanClip *dest,
|
||||
}
|
||||
|
||||
gboolean
|
||||
gsk_vulkan_clip_intersects_rect (const GskVulkanClip *self,
|
||||
const graphene_point_t *offset,
|
||||
const graphene_rect_t *rect)
|
||||
gsk_vulkan_clip_may_intersect_rect (const GskVulkanClip *self,
|
||||
const graphene_point_t *offset,
|
||||
const graphene_rect_t *rect)
|
||||
{
|
||||
graphene_rect_t r = *rect;
|
||||
r.origin.x += offset->x;
|
||||
@ -253,10 +253,8 @@ gsk_vulkan_clip_intersects_rect (const GskVulkanClip *self,
|
||||
|
||||
case GSK_VULKAN_CLIP_NONE:
|
||||
case GSK_VULKAN_CLIP_RECT:
|
||||
return graphene_rect_intersection (&self->rect.bounds, &r, NULL);
|
||||
|
||||
case GSK_VULKAN_CLIP_ROUNDED:
|
||||
return gsk_rounded_rect_intersects_rect (&self->rect, &r);
|
||||
return graphene_rect_intersection (&self->rect.bounds, &r, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ gboolean gsk_vulkan_clip_transform (GskVulk
|
||||
gboolean gsk_vulkan_clip_contains_rect (const GskVulkanClip *self,
|
||||
const graphene_point_t *offset,
|
||||
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
|
||||
gboolean gsk_vulkan_clip_intersects_rect (const GskVulkanClip *self,
|
||||
gboolean gsk_vulkan_clip_may_intersect_rect (const GskVulkanClip *self,
|
||||
const graphene_point_t *offset,
|
||||
const graphene_rect_t *rect) G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
|
@ -1195,7 +1195,7 @@ gsk_vulkan_render_pass_add_node (GskVulkanRenderPass *self,
|
||||
|
||||
/* This catches the corner cases of empty nodes, so after this check
|
||||
* there's quaranteed to be at least 1 pixel that needs to be drawn */
|
||||
if (!gsk_vulkan_clip_intersects_rect (&state->clip, &state->offset, &node->bounds))
|
||||
if (!gsk_vulkan_clip_may_intersect_rect (&state->clip, &state->offset, &node->bounds))
|
||||
return;
|
||||
|
||||
node_type = gsk_render_node_get_node_type (node);
|
||||
|
Loading…
Reference in New Issue
Block a user