From 23e68c09886a3823353c4d8bc67fd59b43d2ea34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 24 May 2020 08:31:40 +0200 Subject: [PATCH] gl renderer: Cache whether clips is rectilinear --- gsk/gl/gskglrenderops.c | 4 ++++ gsk/gl/gskglrenderopsprivate.h | 1 + 2 files changed, 5 insertions(+) diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c index 2effc087eb..c6bc5b4de8 100644 --- a/gsk/gl/gskglrenderops.c +++ b/gsk/gl/gskglrenderops.c @@ -74,6 +74,7 @@ ops_finish (RenderOpBuilder *builder) builder->scale_y = 1; builder->current_modelview = NULL; builder->current_clip = NULL; + builder->clip_is_rectilinear = TRUE; builder->current_render_target = 0; builder->current_texture = 0; builder->current_program = NULL; @@ -316,6 +317,7 @@ ops_push_clip (RenderOpBuilder *self, g_array_append_val (self->clip_stack, *clip); 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); } @@ -333,11 +335,13 @@ ops_pop_clip (RenderOpBuilder *self) if (self->clip_stack->len >= 1) { self->current_clip = head; + self->clip_is_rectilinear = gsk_rounded_rect_is_rectilinear (self->current_clip); ops_set_clip (self, head); } else { self->current_clip = NULL; + self->clip_is_rectilinear = TRUE; } } diff --git a/gsk/gl/gskglrenderopsprivate.h b/gsk/gl/gskglrenderopsprivate.h index feaf741f6e..2ddc048dba 100644 --- a/gsk/gl/gskglrenderopsprivate.h +++ b/gsk/gl/gskglrenderopsprivate.h @@ -174,6 +174,7 @@ typedef struct GArray *clip_stack; /* Pointer into clip_stack */ const GskRoundedRect *current_clip; + guint clip_is_rectilinear; } RenderOpBuilder;