[PATCH weston v2 07/11] Change repaint_needed to bool
Daniel Stone
daniels at collabora.com
Wed Mar 1 11:34:06 UTC 2017
It is only used as a binary value.
Signed-off-by: Daniel Stone <daniels at collabora.com>
---
libweston/compositor-drm.c | 2 +-
libweston/compositor-fbdev.c | 2 +-
libweston/compositor.c | 4 ++--
libweston/compositor.h | 5 ++++-
4 files changed, 8 insertions(+), 5 deletions(-)
v2: New in this revision. Required by change to avoid normalising
next_repaint values to uint32_t msec in the global repaint timer.
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 9a2df16..2715a87 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2931,7 +2931,7 @@ session_notify(struct wl_listener *listener, void *data)
* 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 @@ session_notify(struct wl_listener *listener, void *data)
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 57eafcd..7f3532f 100644
--- a/libweston/compositor.c
+++ b/libweston/compositor.c
@@ -2310,7 +2310,7 @@ weston_output_repaint(struct weston_output *output)
pixman_region32_fini(&output_damage);
- output->repaint_needed = 0;
+ output->repaint_needed = false;
weston_compositor_repick(ec);
@@ -2549,7 +2549,7 @@ weston_output_schedule_repaint(struct weston_output *output)
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 9cdd682..7d6e1c9 100644
--- a/libweston/compositor.h
+++ b/libweston/compositor.h
@@ -170,7 +170,10 @@ struct weston_output {
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;
--
2.9.3
More information about the wayland-devel
mailing list