summaryrefslogtreecommitdiff
path: root/src/screenshooter.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2012-08-03 15:45:23 -0400
committerKristian Høgsberg <krh@bitplanet.net>2012-08-03 16:33:42 -0400
commit79af73e313c732ff9e5bb997a617d0a172844284 (patch)
tree847ea7fca75e1e865282bb93f388055b6992c0c9 /src/screenshooter.c
parentbcf4864bb76963059f8ca983103e9031adc719e8 (diff)
downloadweston-79af73e313c732ff9e5bb997a617d0a172844284.tar.gz
compositor-drm: Disable planes when zoomed or capturing
When the entire output is transformed or we're capturing the output for screenshot or video, disable all output specific overlays (drm planes, hw cursors etc) and move all surfaces into the primary plane.
Diffstat (limited to 'src/screenshooter.c')
-rw-r--r--src/screenshooter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/screenshooter.c b/src/screenshooter.c
index aa8d0c06..ba80ce55 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -101,6 +101,7 @@ screenshooter_frame_notify(struct wl_listener *listener, void *data)
int32_t stride;
uint8_t *pixels, *d, *s;
+ output->disable_planes--;
wl_list_remove(&listener->link);
stride = l->buffer->width * 4;
pixels = malloc(stride * l->buffer->height);
@@ -165,6 +166,7 @@ screenshooter_shoot(struct wl_client *client,
l->listener.notify = screenshooter_frame_notify;
wl_signal_add(&output->frame_signal, &l->listener);
+ output->disable_planes++;
weston_output_schedule_repaint(output);
}
@@ -212,6 +214,7 @@ screenshooter_binding(struct wl_seat *seat, uint32_t time, uint32_t key,
}
struct weston_recorder {
+ struct weston_output *output;
uint32_t *frame, *rect;
uint32_t total;
int fd;
@@ -346,6 +349,7 @@ weston_recorder_create(struct weston_output *output, const char *filename)
recorder->rect = malloc(size);
recorder->total = 0;
recorder->count = 0;
+ recorder->output = output;
memset(recorder->frame, 0, size);
recorder->fd = open(filename,
@@ -368,6 +372,7 @@ weston_recorder_create(struct weston_output *output, const char *filename)
recorder->frame_listener.notify = weston_recorder_frame_notify;
wl_signal_add(&output->frame_signal, &recorder->frame_listener);
+ output->disable_planes++;
weston_output_damage(output);
}
@@ -378,6 +383,7 @@ weston_recorder_destroy(struct weston_recorder *recorder)
close(recorder->fd);
free(recorder->frame);
free(recorder->rect);
+ recorder->output->disable_planes--;
free(recorder);
}