Change repaint_needed to bool
It is only used as a binary value.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 3cb8f7e..72696d5 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2995,7 +2995,7 @@
* pending frame callbacks. */
wl_list_for_each(output, &compositor->output_list, base.link) {
- output->base.repaint_needed = 0;
+ output->base.repaint_needed = false;
drmModeSetCursor(b->drm.fd, output->crtc_id, 0, 0, 0);
}
diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
index 44f0cf5..6f976d1 100644
--- a/libweston/compositor-fbdev.c
+++ b/libweston/compositor-fbdev.c
@@ -693,7 +693,7 @@
wl_list_for_each(output,
&compositor->output_list, link) {
- output->repaint_needed = 0;
+ output->repaint_needed = false;
}
}
}
diff --git a/libweston/compositor.c b/libweston/compositor.c
index 4962618..80268bc 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -2310,7 +2310,7 @@
pixman_region32_fini(&output_damage);
- output->repaint_needed = 0;
+ output->repaint_needed = false;
weston_compositor_repick(ec);
@@ -2549,7 +2549,7 @@
TL_POINT("core_repaint_req", TLP_OUTPUT(output), TLP_END);
loop = wl_display_get_event_loop(compositor->wl_display);
- output->repaint_needed = 1;
+ output->repaint_needed = true;
if (output->repaint_scheduled)
return;
diff --git a/libweston/compositor.h b/libweston/compositor.h
index 08e728a..45dcb6d 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -170,7 +170,10 @@
pixman_region32_t region;
pixman_region32_t previous_damage;
- int repaint_needed;
+
+ /** True if damage has occurred since the last repaint for this output;
+ * if set, a repaint will eventually occur. */
+ bool repaint_needed;
int repaint_scheduled;
struct wl_event_source *repaint_timer;
struct weston_output_zoom zoom;