diff options
author | Daniel van Vugt <daniel.van.vugt@canonical.com> | 2020-06-19 15:34:59 +0800 |
---|---|---|
committer | Jonas Ã…dahl <jadahl@gmail.com> | 2020-06-23 09:11:54 +0000 |
commit | f511f94aa29d9e265962b3dc7cbaeb392f63a1f8 (patch) | |
tree | 8d419a7aa453cfa92a7e93c457a62557f0593370 | |
parent | 3187fe8ebc73cb3907d1d02edecedc4e4ab0c689 (diff) | |
download | mutter-f511f94aa29d9e265962b3dc7cbaeb392f63a1f8.tar.gz |
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
-rw-r--r-- | clutter/clutter/cogl/clutter-stage-cogl.c | 4 |
1 files 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); |