From 43c7a824612ef4285d893599467cb8d7bd71cfe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 6 Mar 2020 12:59:41 +0100 Subject: [PATCH] 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 --- clutter/clutter/cogl/clutter-stage-cogl.c | 27 ++--------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c index 75e5dfa0c..f3745303c 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/clutter/cogl/clutter-stage-cogl.c @@ -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)