[mutter] clutter-stage-cogl: Fix uninitialized variable `use_clipped_redraw`
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter-stage-cogl: Fix uninitialized variable `use_clipped_redraw`
- Date: Tue, 23 Jun 2020 09:31:02 +0000 (UTC)
commit f511f94aa29d9e265962b3dc7cbaeb392f63a1f8
Author: Daniel van Vugt <daniel van vugt canonical com>
Date: Fri Jun 19 15:34:59 2020 +0800
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 db87e39337..f7f71e6e16 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]