[gtk/matthiasc/for-master: 5/5] ngl: Allow passing bounds to update_clip




commit 1d9c581f109f7eef08a7541a1c40360448136766
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 11 11:57:22 2021 -0400

    ngl: Allow passing bounds to update_clip
    
    update_clip only uses the bounds of the node that
    we are currently passing. This opens the door to
    updating the clip while handling a single node.

 gsk/ngl/gsknglrenderjob.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gsk/ngl/gsknglrenderjob.c b/gsk/ngl/gsknglrenderjob.c
index 24af932e1f..60f0cff82c 100644
--- a/gsk/ngl/gsknglrenderjob.c
+++ b/gsk/ngl/gsknglrenderjob.c
@@ -818,9 +818,9 @@ interval_contains (float p1, float w1,
 }
 
 static inline gboolean
-gsk_ngl_render_job_update_clip (GskNglRenderJob     *job,
-                                const GskRenderNode *node,
-                                gboolean            *pushed_clip)
+gsk_ngl_render_job_update_clip (GskNglRenderJob       *job,
+                                const graphene_rect_t *bounds,
+                                gboolean              *pushed_clip)
 {
   graphene_rect_t transformed_bounds;
   gboolean no_clip = FALSE;
@@ -834,7 +834,7 @@ gsk_ngl_render_job_update_clip (GskNglRenderJob     *job,
       return TRUE;
     }
 
-  gsk_ngl_render_job_transform_bounds (job, &node->bounds, &transformed_bounds);
+  gsk_ngl_render_job_transform_bounds (job, bounds, &transformed_bounds);
 
   if (!rect_intersects (&job->current_clip->rect.bounds, &transformed_bounds))
     {
@@ -3429,7 +3429,7 @@ gsk_ngl_render_job_visit_node (GskNglRenderJob     *job,
   if (node_is_invisible (node))
     return;
 
-  if (!gsk_ngl_render_job_update_clip (job, node, &has_clip))
+  if (!gsk_ngl_render_job_update_clip (job, &node->bounds, &has_clip))
     return;
 
   switch (gsk_render_node_get_node_type (node))


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