gl renderer: Refactor render_clipped_child

This commit is contained in:
Timm Bäder 2020-05-24 08:31:55 +02:00
parent 23e68c0988
commit 094788f1a3

View File

@ -1164,9 +1164,22 @@ render_clipped_child (GskGLRenderer *self,
ops_transform_bounds_modelview (builder, clip, &transformed_clip);
/* Intersection might end up having rounded corners again */
if (!gsk_rounded_rect_is_rectilinear (builder->current_clip))
if (builder->clip_is_rectilinear)
{
/* Simple case: */
graphene_rect_intersection (&transformed_clip,
&builder->current_clip->bounds,
&intersection);
gsk_rounded_rect_init_from_rect (&child_clip, &intersection, 0.0f);
ops_push_clip (builder, &child_clip);
gsk_gl_renderer_add_render_ops (self, child, builder);
ops_pop_clip (builder);
return;
}
/* Intersection might end up having rounded corners again */
if (!rounded_inner_rect_contains_rect (builder->current_clip,
&transformed_clip))
{
@ -1198,18 +1211,7 @@ render_clipped_child (GskGLRenderer *self,
load_offscreen_vertex_data (ops_draw (builder, NULL), child, builder);
return;
}
}
/* Simple case: */
graphene_rect_intersection (&transformed_clip,
&builder->current_clip->bounds,
&intersection);
gsk_rounded_rect_init_from_rect (&child_clip, &intersection, 0.0f);
ops_push_clip (builder, &child_clip);
gsk_gl_renderer_add_render_ops (self, child, builder);
ops_pop_clip (builder);
}
static inline void