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.
This commit is contained in:
+3
-2
@@ -1142,8 +1142,7 @@ weston_output_finish_frame(struct weston_output *output, int msecs)
|
|||||||
wl_display_get_event_loop(compositor->wl_display);
|
wl_display_get_event_loop(compositor->wl_display);
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
wl_signal_emit(&output->frame_signal, &msecs);
|
output->frame_time = msecs;
|
||||||
|
|
||||||
if (output->repaint_needed) {
|
if (output->repaint_needed) {
|
||||||
weston_output_repaint(output, msecs);
|
weston_output_repaint(output, msecs);
|
||||||
return;
|
return;
|
||||||
@@ -2871,6 +2870,8 @@ weston_output_do_read_pixels(struct weston_output *output)
|
|||||||
{
|
{
|
||||||
struct weston_read_pixels *r, *next;
|
struct weston_read_pixels *r, *next;
|
||||||
|
|
||||||
|
wl_signal_emit(&output->frame_signal, &output->frame_time);
|
||||||
|
|
||||||
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
glPixelStorei(GL_PACK_ALIGNMENT, 1);
|
||||||
wl_list_for_each_safe(r, next, &output->read_pixels_list, link) {
|
wl_list_for_each_safe(r, next, &output->read_pixels_list, link) {
|
||||||
glReadPixels(r->x, r->y, r->width, r->height,
|
glReadPixels(r->x, r->y, r->width, r->height,
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ struct weston_output {
|
|||||||
int dirty;
|
int dirty;
|
||||||
struct wl_list read_pixels_list;
|
struct wl_list read_pixels_list;
|
||||||
struct wl_signal frame_signal;
|
struct wl_signal frame_signal;
|
||||||
|
uint32_t frame_time;
|
||||||
|
|
||||||
char *make, *model;
|
char *make, *model;
|
||||||
uint32_t subpixel;
|
uint32_t subpixel;
|
||||||
|
|||||||
@@ -275,11 +275,6 @@ weston_recorder_frame_notify(struct wl_listener *listener, void *data)
|
|||||||
r = pixman_region32_rectangles(&damage, &n);
|
r = pixman_region32_rectangles(&damage, &n);
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return;
|
return;
|
||||||
if (recorder->count++ == 0)
|
|
||||||
/* The first callback gives us the frame immediately
|
|
||||||
* before the weston_output_damage() call, and
|
|
||||||
* typically doesn't give us a full frame of damage.*/
|
|
||||||
return;
|
|
||||||
|
|
||||||
header.msecs = msecs;
|
header.msecs = msecs;
|
||||||
header.nrects = n;
|
header.nrects = n;
|
||||||
|
|||||||
Reference in New Issue
Block a user