[mutter] clutter/cogl/stage: Rename have_clip to is_full_redraw



commit 86ccc28413ef0a59c010dc19123f486b54e25973
Author: Jonas Ådahl <jadahl gmail com>
Date:   Thu Feb 6 08:31:04 2020 +0100

    clutter/cogl/stage: Rename have_clip to is_full_redraw
    
    The 'have_clip' variable has repeatedly confused me to meaning that
    there is a clip. What it actually means is that the effective clip
    covers the whole view; the 'redraw_clip == NULL' meaning full redraw is
    an important implementation detail for the context, and makes the
    intention of the variable unclear; especially since we will after a
    couple of blocks will *always* have a clip, just that it covers the
    whole view.
    
    Rename the variable to 'is_full_redraw' and negate the meaning, aiming
    to make things a lot more clear.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/1042

 clutter/clutter/cogl/clutter-stage-cogl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c
index a2a946f9e..807fa08fa 100644
--- a/clutter/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/clutter/cogl/clutter-stage-cogl.c
@@ -685,7 +685,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
     clutter_stage_view_cogl_get_instance_private (view_cogl);
   CoglFramebuffer *fb = clutter_stage_view_get_framebuffer (view);
   cairo_rectangle_int_t view_rect;
-  gboolean have_clip;
+  gboolean is_full_redraw;
   gboolean may_use_clipped_redraw;
   gboolean use_clipped_redraw;
   gboolean can_blit_sub_buffer;
@@ -717,7 +717,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
 
   /* NB: a NULL redraw clip == full stage redraw */
   if (!stage_cogl->redraw_clip)
-    have_clip = FALSE;
+    is_full_redraw = TRUE;
   else
     {
       cairo_region_t *view_region;
@@ -726,14 +726,14 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
       view_region = cairo_region_create_rectangle (&view_rect);
       cairo_region_intersect (redraw_clip, view_region);
 
-      have_clip = !cairo_region_equal (redraw_clip, view_region);
+      is_full_redraw = cairo_region_equal (redraw_clip, view_region);
       cairo_region_destroy (view_region);
     }
 
   may_use_clipped_redraw = FALSE;
   if (_clutter_stage_window_can_clip_redraws (stage_window) &&
       (can_blit_sub_buffer || has_buffer_age) &&
-      have_clip &&
+      !is_full_redraw &&
       /* some drivers struggle to get going and produce some junk
        * frames when starting up... */
       cogl_onscreen_get_frame_counter (COGL_ONSCREEN (fb)) > 3)


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