[PATCH weston 3/5] compositor: refactor to weston_output_schedule_repaint_reset()
Pekka Paalanen
ppaalanen at gmail.com
Thu Feb 12 05:30:15 PST 2015
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
No functional changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
src/compositor.c | 35 ++++++++++++++++++++++-------------
1 file changed, 22 insertions(+), 13 deletions(-)
diff --git a/src/compositor.c b/src/compositor.c
index c2c975d..b0bca24 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2115,15 +2115,33 @@ weston_compositor_read_input(int fd, uint32_t mask, void *data)
return 1;
}
+static void
+weston_output_schedule_repaint_reset(struct weston_output *output)
+{
+ struct weston_compositor *compositor = output->compositor;
+ struct wl_event_loop *loop;
+ int fd;
+
+ output->repaint_scheduled = 0;
+ TL_POINT("core_repaint_exit_loop", TLP_OUTPUT(output), TLP_END);
+
+ if (compositor->input_loop_source)
+ return;
+
+ loop = wl_display_get_event_loop(compositor->wl_display);
+ fd = wl_event_loop_get_fd(compositor->input_loop);
+ compositor->input_loop_source =
+ wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
+ weston_compositor_read_input, compositor);
+}
+
WL_EXPORT void
weston_output_finish_frame(struct weston_output *output,
const struct timespec *stamp,
uint32_t presented_flags)
{
struct weston_compositor *compositor = output->compositor;
- struct wl_event_loop *loop =
- wl_display_get_event_loop(compositor->wl_display);
- int fd, r;
+ int r;
uint32_t refresh_nsec;
TL_POINT("core_repaint_finished", TLP_OUTPUT(output),
@@ -2145,16 +2163,7 @@ weston_output_finish_frame(struct weston_output *output,
return;
}
- output->repaint_scheduled = 0;
- TL_POINT("core_repaint_exit_loop", TLP_OUTPUT(output), TLP_END);
-
- if (compositor->input_loop_source)
- return;
-
- fd = wl_event_loop_get_fd(compositor->input_loop);
- compositor->input_loop_source =
- wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
- weston_compositor_read_input, compositor);
+ weston_output_schedule_repaint_reset(output);
}
static void
--
2.0.5
More information about the wayland-devel
mailing list