From f511f94aa29d9e265962b3dc7cbaeb392f63a1f8 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Fri, 19 Jun 2020 15:34:59 +0800 Subject: [PATCH] clutter-stage-cogl: Fix uninitialized variable `use_clipped_redraw` I noticed my system would fall back to the slow unclipped (and uncullable) paint path whenever a window touched the left edge of the screen. Turns out that was a red herring. Just that `use_clipped_redraw` was uninitialized so clipping/culling was used randomly. So the compiler failed to notice `use_clipped_redraw` was uninitialized. Weirdly, as soon as you fix that it starts complaining that `buffer_age` might be uninitialized, which appears to be wrong. So we initialize that too, to shut up the compiler warnings/errors. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1323 --- clutter/clutter/cogl/clutter-stage-cogl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/cogl/clutter-stage-cogl.c b/clutter/clutter/cogl/clutter-stage-cogl.c index db87e3933..f7f71e6e1 100644 --- a/clutter/clutter/cogl/clutter-stage-cogl.c +++ b/clutter/clutter/cogl/clutter-stage-cogl.c @@ -551,7 +551,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window, CoglFramebuffer *onscreen = clutter_stage_view_get_onscreen (view); cairo_rectangle_int_t view_rect; gboolean is_full_redraw; - gboolean use_clipped_redraw; + gboolean use_clipped_redraw = TRUE; gboolean can_blit_sub_buffer; gboolean has_buffer_age; gboolean swap_with_damage; @@ -561,7 +561,7 @@ clutter_stage_cogl_redraw_view (ClutterStageWindow *stage_window, cairo_region_t *swap_region; float fb_scale; int fb_width, fb_height; - int buffer_age; + int buffer_age = 0; gboolean res; clutter_stage_view_get_layout (view, &view_rect);