clutter/stage-cogl: Cleanup setting of the damage history

Since we now check for the buffer age before setting up the
fb_clip_region, that region will be set to the full extents of the view
in case the buffer age is invalid. This in turn means we don't have to
do this again later and can simply fill the damage history with the
fb_clip_region that's already set for us.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1113
This commit is contained in:
Jonas Dreßler 2020-03-06 12:59:41 +01:00 committed by Jonas Ådahl
parent 066e78c9b3
commit 43c7a82461

View File

@ -496,17 +496,6 @@ fill_current_damage_history (ClutterStageView *view,
view_priv->damage_index++;
}
static void
fill_current_damage_history_rectangle (ClutterStageView *view,
const cairo_rectangle_int_t *rect)
{
cairo_region_t *damage;
damage = cairo_region_create_rectangle (rect);
fill_current_damage_history (view, damage);
cairo_region_destroy (damage);
}
static cairo_region_t *
transform_swap_region_to_onscreen (ClutterStageView *view,
cairo_region_t *swap_region)
@ -657,14 +646,14 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
swap_with_damage = FALSE;
if (has_buffer_age)
{
fill_current_damage_history (view, fb_clip_region);
if (use_clipped_redraw)
{
cairo_region_t *fb_damage;
cairo_region_t *view_damage;
int i;
fill_current_damage_history (view, fb_clip_region);
fb_damage = cairo_region_create ();
for (i = 1; i <= buffer_age; i++)
@ -697,18 +686,6 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window,
swap_with_damage = TRUE;
}
else if (!use_clipped_redraw)
{
cairo_rectangle_int_t fb_damage;
fb_damage = (cairo_rectangle_int_t) {
.x = 0,
.y = 0,
.width = ceilf (view_rect.width * fb_scale),
.height = ceilf (view_rect.height * fb_scale)
};
fill_current_damage_history_rectangle (view, &fb_damage);
}
}
if (use_clipped_redraw)