gl renderer: Cache whether clips is rectilinear

This commit is contained in:
Timm Bäder 2020-05-24 08:31:40 +02:00
parent 60902484fd
commit 23e68c0988
2 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,7 @@ ops_finish (RenderOpBuilder *builder)
builder->scale_y = 1; builder->scale_y = 1;
builder->current_modelview = NULL; builder->current_modelview = NULL;
builder->current_clip = NULL; builder->current_clip = NULL;
builder->clip_is_rectilinear = TRUE;
builder->current_render_target = 0; builder->current_render_target = 0;
builder->current_texture = 0; builder->current_texture = 0;
builder->current_program = NULL; builder->current_program = NULL;
@ -316,6 +317,7 @@ ops_push_clip (RenderOpBuilder *self,
g_array_append_val (self->clip_stack, *clip); g_array_append_val (self->clip_stack, *clip);
self->current_clip = &g_array_index (self->clip_stack, GskRoundedRect, self->clip_stack->len - 1); self->current_clip = &g_array_index (self->clip_stack, GskRoundedRect, self->clip_stack->len - 1);
self->clip_is_rectilinear = gsk_rounded_rect_is_rectilinear (self->current_clip);
ops_set_clip (self, clip); ops_set_clip (self, clip);
} }
@ -333,11 +335,13 @@ ops_pop_clip (RenderOpBuilder *self)
if (self->clip_stack->len >= 1) if (self->clip_stack->len >= 1)
{ {
self->current_clip = head; self->current_clip = head;
self->clip_is_rectilinear = gsk_rounded_rect_is_rectilinear (self->current_clip);
ops_set_clip (self, head); ops_set_clip (self, head);
} }
else else
{ {
self->current_clip = NULL; self->current_clip = NULL;
self->clip_is_rectilinear = TRUE;
} }
} }

View File

@ -174,6 +174,7 @@ typedef struct
GArray *clip_stack; GArray *clip_stack;
/* Pointer into clip_stack */ /* Pointer into clip_stack */
const GskRoundedRect *current_clip; const GskRoundedRect *current_clip;
guint clip_is_rectilinear;
} RenderOpBuilder; } RenderOpBuilder;