gl renderer: Cache whether clips is rectilinear
authorTimm Bäder <mail@baedert.org>
Sun, 24 May 2020 06:31:40 +0000 (08:31 +0200)
committerTimm Bäder <mail@baedert.org>
Sun, 24 May 2020 13:59:05 +0000 (15:59 +0200)
gsk/gl/gskglrenderops.c
gsk/gl/gskglrenderopsprivate.h

index 2effc087eb375813293821fd8ea7a6e4ff58fe85..c6bc5b4de8a1a0ed0a5de892faf5d3ba16975895 100644 (file)
@@ -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;
     }
 }
 
index feaf741f6ef0bc9492206f67905d746b69f3c70b..2ddc048dba865ef7cf244b6bcd8cbf692d19b04c 100644 (file)
@@ -174,6 +174,7 @@ typedef struct
   GArray *clip_stack;
   /* Pointer into clip_stack */
   const GskRoundedRect *current_clip;
+  guint clip_is_rectilinear;
 } RenderOpBuilder;