Revert "move frame_signal emission to weston_output_repaint()"
authorLeandro Ribeiro <leandrohr@riseup.net>
Tue, 3 Dec 2019 15:22:11 +0000 (12:22 -0300)
committerLeandro Ribeiro <leandrohr@riseup.net>
Tue, 3 Dec 2019 15:31:53 +0000 (12:31 -0300)
The emission of frame_signal has to happen before a flip, otherwise
glReadPixels() could read an old frame or even worse an uninitialized buffer.
So move frame_signal emission back to renderers.

This reverts commit 2619bfe420c493b0adef57cf2f57b3b5fe7d7078.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
libweston/compositor.c
libweston/pixman-renderer.c
libweston/renderer-gl/gl-renderer.c

index 2025039e60b0dbe92007701a79475ebb5aaa29c1..72a2905e6da912dae334c84f7595218986d0bd8c 100644 (file)
@@ -2723,7 +2723,6 @@ weston_output_repaint(struct weston_output *output, void *repaint_data)
                weston_output_update_matrix(output);
 
        r = output->repaint(output, &output_damage, repaint_data);
-       wl_signal_emit(&output->frame_signal, &output_damage);
 
        pixman_region32_fini(&output_damage);
 
index f73be2d269ef49f66864bf55725be0e907898a94..378845d06ce68020cdfd941a2cec69f2d06e5646 100644 (file)
@@ -580,6 +580,7 @@ pixman_renderer_repaint_output(struct weston_output *output,
        pixman_region32_fini(&hw_damage);
 
        pixman_region32_copy(&output->previous_damage, output_damage);
+       wl_signal_emit(&output->frame_signal, output);
 
        /* Actual flip should be done by caller */
 }
index d10890469a0d127b4199518df8a7a68dadda8eea..14c5f8b141877882a06acb1524f9591db49b970b 100644 (file)
@@ -1474,6 +1474,7 @@ gl_renderer_repaint_output(struct weston_output *output,
        draw_output_borders(output, border_status);
 
        pixman_region32_copy(&output->previous_damage, output_damage);
+       wl_signal_emit(&output->frame_signal, output);
 
        go->end_render_sync = create_render_sync(gr);