compositor: Emit frame_signal from weston_output_do_read_pixels()
This is the point where we have just finished rendering the new scene
but before we swap it to the front buffer. At this point, the
output->previous_damage region exactly corresponds to what was just
renders, as compared to previous frame.
diff --git a/src/compositor.c b/src/compositor.c
index 00b8f3e..a65dd84 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1142,8 +1142,7 @@
wl_display_get_event_loop(compositor->wl_display);
int fd;
- wl_signal_emit(&output->frame_signal, &msecs);
-
+ output->frame_time = msecs;
if (output->repaint_needed) {
weston_output_repaint(output, msecs);
return;
@@ -2871,6 +2870,8 @@
{
struct weston_read_pixels *r, *next;
+ wl_signal_emit(&output->frame_signal, &output->frame_time);
+
glPixelStorei(GL_PACK_ALIGNMENT, 1);
wl_list_for_each_safe(r, next, &output->read_pixels_list, link) {
glReadPixels(r->x, r->y, r->width, r->height,