[gtk] gl renderer: Speed up bounds transformation



commit 1dea6d4fc751c408f0c909c8d2d4cbf6ec87aa7e
Author: Timm Bäder <mail baedert org>
Date:   Fri Dec 20 20:31:37 2019 +0100

    gl renderer: Speed up bounds transformation
    
    We started saving the scale of the current modelview directly in the
    RenderOpBuilder, so we don't need to poke the modelview stack anymore.

 gsk/gl/gskglrenderops.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index a4b7786d30..39916be36c 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -180,17 +180,13 @@ ops_transform_bounds_modelview (const RenderOpBuilder *builder,
                                 const graphene_rect_t *src,
                                 graphene_rect_t       *dst)
 {
-  const MatrixStackEntry *head;
-
   g_assert (builder->mv_stack != NULL);
   g_assert (builder->mv_stack->len >= 1);
 
-  head = &g_array_index (builder->mv_stack, MatrixStackEntry, builder->mv_stack->len - 1);
-
   gsk_transform_transform_bounds (builder->current_modelview, src, dst);
 
-  dst->origin.x += builder->dx * head->metadata.scale_x;
-  dst->origin.y += builder->dy * head->metadata.scale_y;
+  dst->origin.x += builder->dx * builder->scale_x;
+  dst->origin.y += builder->dy * builder->scale_y;
 }
 
 void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]