[mutter] clutter/stage: Clarify comments in add_to_stage_clip() a bit



commit 0da8a49719feb26256f9c1d27deaed420e776bcf
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Mon Nov 16 20:52:32 2020 +0100

    clutter/stage: Clarify comments in add_to_stage_clip() a bit
    
    The first comment isn't really needed anymore since
    the is_full_stage_redraw_queued() underneath is quite self-explaining.
    
    Also rephrase the second comment a bit, including that
    _clutter_paint_volume_get_stage_paint_box() does the aligning to the
    pixel grid.
    
    Finally, the last comment also looks out of date since we do that
    rounding inside _clutter_paint_volume_get_stage_paint_box(), so remove
    it.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1511>

 clutter/clutter/clutter-stage.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index d9191c0a25..430233534e 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -2817,9 +2817,6 @@ add_to_stage_clip (ClutterStage       *stage,
   if (CLUTTER_ACTOR_IN_DESTRUCTION (CLUTTER_ACTOR (stage)))
     return;
 
-  /* If the backend can't do anything with redraw clips (e.g. it already knows
-   * it needs to redraw everything anyway) then don't spend time transforming
-   * any clip volume into stage coordinates... */
   stage_window = _clutter_stage_get_window (stage);
   if (stage_window == NULL)
     return;
@@ -2836,8 +2833,9 @@ add_to_stage_clip (ClutterStage       *stage,
   if (redraw_clip->is_empty)
     return;
 
-  /* Convert the clip volume into stage coordinates and then into an
-   * axis aligned stage coordinates bounding box... */
+  /* Now transform and project the clip volume to view coordinates and get
+   * the axis aligned bounding box that's aligned to the pixel grid.
+   */
   _clutter_paint_volume_get_stage_paint_box (redraw_clip,
                                              stage,
                                              &bounding_box);
@@ -2854,8 +2852,6 @@ add_to_stage_clip (ClutterStage       *stage,
       intersection_box.y2 <= intersection_box.y1)
     return;
 
-  /* when converting to integer coordinates make sure we round the edges of the
-   * clip rectangle outwards... */
   stage_clip.x = intersection_box.x1;
   stage_clip.y = intersection_box.y1;
   stage_clip.width = intersection_box.x2 - stage_clip.x;


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