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>
This commit is contained in:
Jonas Dreßler 2020-11-16 20:52:32 +01:00 committed by Marge Bot
parent 906124b09f
commit 0da8a49719

View File

@ -2817,9 +2817,6 @@ add_to_stage_clip (ClutterStage *stage,
if (CLUTTER_ACTOR_IN_DESTRUCTION (CLUTTER_ACTOR (stage))) if (CLUTTER_ACTOR_IN_DESTRUCTION (CLUTTER_ACTOR (stage)))
return; 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); stage_window = _clutter_stage_get_window (stage);
if (stage_window == NULL) if (stage_window == NULL)
return; return;
@ -2836,8 +2833,9 @@ add_to_stage_clip (ClutterStage *stage,
if (redraw_clip->is_empty) if (redraw_clip->is_empty)
return; return;
/* Convert the clip volume into stage coordinates and then into an /* Now transform and project the clip volume to view coordinates and get
* axis aligned stage coordinates bounding box... */ * the axis aligned bounding box that's aligned to the pixel grid.
*/
_clutter_paint_volume_get_stage_paint_box (redraw_clip, _clutter_paint_volume_get_stage_paint_box (redraw_clip,
stage, stage,
&bounding_box); &bounding_box);
@ -2854,8 +2852,6 @@ add_to_stage_clip (ClutterStage *stage,
intersection_box.y2 <= intersection_box.y1) intersection_box.y2 <= intersection_box.y1)
return; 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.x = intersection_box.x1;
stage_clip.y = intersection_box.y1; stage_clip.y = intersection_box.y1;
stage_clip.width = intersection_box.x2 - stage_clip.x; stage_clip.width = intersection_box.x2 - stage_clip.x;