[PATCH RFC 1/4] screenshoter: don't use hardcoded bpp value
Kristian Høgsberg
hoegsberg at gmail.com
Mon Jan 7 06:51:29 PST 2013
On Sun, Jan 06, 2013 at 12:12:40PM +0300, Vasily Khoruzhick wrote:
> Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
Looks good, applied.
Kristian
> ---
> src/screenshooter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/screenshooter.c b/src/screenshooter.c
> index 840dfb8..662aad4 100644
> --- a/src/screenshooter.c
> +++ b/src/screenshooter.c
> @@ -103,7 +103,7 @@ screenshooter_frame_notify(struct wl_listener *listener, void *data)
>
> output->disable_planes--;
> wl_list_remove(&listener->link);
> - stride = l->buffer->width * 4;
> + stride = l->buffer->width * (PIXMAN_FORMAT_BPP(output->compositor->read_format) / 8);
> pixels = malloc(stride * l->buffer->height);
>
> if (pixels == NULL) {
> --
> 1.8.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list