compositor: Pass weston_output as the frame_signal argument
The frame time is in weston_output, so passing weston_output itself is more useful.
This commit is contained in:
parent
70b8358aa0
commit
e0f832b4f0
|
@ -147,7 +147,7 @@ android_output_repaint(struct weston_output *base, pixman_region32_t *damage)
|
||||||
wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
|
wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
|
||||||
weston_surface_draw(surface, &output->base, damage);
|
weston_surface_draw(surface, &output->base, damage);
|
||||||
|
|
||||||
wl_signal_emit(&output->frame_signal, &output->frame_time);
|
wl_signal_emit(&output->base.frame_signal, output);
|
||||||
|
|
||||||
ret = eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
ret = eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
||||||
if (ret == EGL_FALSE && !errored) {
|
if (ret == EGL_FALSE && !errored) {
|
||||||
|
|
|
@ -305,7 +305,7 @@ drm_output_render(struct drm_output *output, pixman_region32_t *damage)
|
||||||
wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
|
wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
|
||||||
weston_surface_draw(surface, &output->base, damage);
|
weston_surface_draw(surface, &output->base, damage);
|
||||||
|
|
||||||
wl_signal_emit(&output->frame_signal, &output->frame_time);
|
wl_signal_emit(&output->base.frame_signal, output);
|
||||||
|
|
||||||
eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
||||||
bo = gbm_surface_lock_front_buffer(output->surface);
|
bo = gbm_surface_lock_front_buffer(output->surface);
|
||||||
|
|
|
@ -347,7 +347,7 @@ wayland_output_repaint(struct weston_output *output_base,
|
||||||
|
|
||||||
draw_border(output);
|
draw_border(output);
|
||||||
|
|
||||||
wl_signal_emit(&output->frame_signal, &output->frame_time);
|
wl_signal_emit(&output->base.frame_signal, output);
|
||||||
|
|
||||||
eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
||||||
callback = wl_surface_frame(output->parent.surface);
|
callback = wl_surface_frame(output->parent.surface);
|
||||||
|
|
|
@ -270,7 +270,7 @@ x11_output_repaint(struct weston_output *output_base,
|
||||||
wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
|
wl_list_for_each_reverse(surface, &compositor->base.surface_list, link)
|
||||||
weston_surface_draw(surface, &output->base, damage);
|
weston_surface_draw(surface, &output->base, damage);
|
||||||
|
|
||||||
wl_signal_emit(&output->frame_signal, &output->frame_time);
|
wl_signal_emit(&output->base.frame_signal, output);
|
||||||
|
|
||||||
eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
eglSwapBuffers(compositor->base.egl_display, output->egl_surface);
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@ struct screenshooter_frame_listener {
|
||||||
struct wl_listener listener;
|
struct wl_listener listener;
|
||||||
struct wl_buffer *buffer;
|
struct wl_buffer *buffer;
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
struct weston_output *output;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -98,7 +97,7 @@ screenshooter_frame_notify(struct wl_listener *listener, void *data)
|
||||||
struct screenshooter_frame_listener *l =
|
struct screenshooter_frame_listener *l =
|
||||||
container_of(listener,
|
container_of(listener,
|
||||||
struct screenshooter_frame_listener, listener);
|
struct screenshooter_frame_listener, listener);
|
||||||
struct weston_output *output = l->output;
|
struct weston_output *output = data;
|
||||||
int32_t stride;
|
int32_t stride;
|
||||||
uint8_t *pixels, *d, *s;
|
uint8_t *pixels, *d, *s;
|
||||||
|
|
||||||
|
@ -163,7 +162,6 @@ screenshooter_shoot(struct wl_client *client,
|
||||||
|
|
||||||
l->buffer = buffer;
|
l->buffer = buffer;
|
||||||
l->resource = resource;
|
l->resource = resource;
|
||||||
l->output = output;
|
|
||||||
|
|
||||||
l->listener.notify = screenshooter_frame_notify;
|
l->listener.notify = screenshooter_frame_notify;
|
||||||
wl_signal_add(&output->frame_signal, &l->listener);
|
wl_signal_add(&output->frame_signal, &l->listener);
|
||||||
|
@ -214,7 +212,6 @@ screenshooter_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct weston_recorder {
|
struct weston_recorder {
|
||||||
struct weston_output *output;
|
|
||||||
uint32_t *frame, *rect;
|
uint32_t *frame, *rect;
|
||||||
uint32_t total;
|
uint32_t total;
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -258,8 +255,8 @@ weston_recorder_frame_notify(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct weston_recorder *recorder =
|
struct weston_recorder *recorder =
|
||||||
container_of(listener, struct weston_recorder, frame_listener);
|
container_of(listener, struct weston_recorder, frame_listener);
|
||||||
struct weston_output *output = recorder->output;
|
struct weston_output *output = data;
|
||||||
uint32_t msecs = * (uint32_t *) data;
|
uint32_t msecs = output->frame_time;
|
||||||
pixman_box32_t *r;
|
pixman_box32_t *r;
|
||||||
pixman_region32_t damage;
|
pixman_region32_t damage;
|
||||||
int i, j, k, n, width, height, run, stride;
|
int i, j, k, n, width, height, run, stride;
|
||||||
|
@ -271,8 +268,8 @@ weston_recorder_frame_notify(struct wl_listener *listener, void *data)
|
||||||
struct iovec v[2];
|
struct iovec v[2];
|
||||||
|
|
||||||
pixman_region32_init(&damage);
|
pixman_region32_init(&damage);
|
||||||
pixman_region32_intersect(&damage, &recorder->output->region,
|
pixman_region32_intersect(&damage, &output->region,
|
||||||
&recorder->output->previous_damage);
|
&output->previous_damage);
|
||||||
|
|
||||||
r = pixman_region32_rectangles(&damage, &n);
|
r = pixman_region32_rectangles(&damage, &n);
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
|
@ -342,7 +339,6 @@ weston_recorder_create(struct weston_output *output, const char *filename)
|
||||||
struct { uint32_t magic, format, width, height; } header;
|
struct { uint32_t magic, format, width, height; } header;
|
||||||
|
|
||||||
recorder = malloc(sizeof *recorder);
|
recorder = malloc(sizeof *recorder);
|
||||||
recorder->output = output;
|
|
||||||
|
|
||||||
stride = output->current->width;
|
stride = output->current->width;
|
||||||
size = stride * 4 * output->current->height;
|
size = stride * 4 * output->current->height;
|
||||||
|
|
Loading…
Reference in New Issue