[PATCH] screenshooter: Properly handle multiple outputs.

Rob Bradford rob at robster.org.uk
Fri Apr 6 09:15:33 PDT 2012


Hi,

> -       for (i = 0; i < buffer->height; i++) {
> -               memcpy(d, s, stride);
> -               d += stride;
> -               s -= stride;
> +       for (i = 0; i < output->current->height; i++) {
> +               memcpy(d + output->x * 4, s, output_stride);
> +               d += buffer_stride;
> +               s -= output_stride;

Neil pointed out that the screenshooter interface leaks that that the
image is OpenGL row order. The flip into the usual bitmap order is
then done client side before being saved into a png.

My first thought was to propose that the buffer we export is in
conventional bitmap order (i.e. that the flip happens in Weston.) This
means that we could potentially use MESA_pack_invert to avoid the
flip.

However in the non MESA_pack_invert case that would mean we would have
to allocate an extra buffer to hold the data from glReadPixels and
then copy that into the SHM buffer.

So alternatively we could expose whether the buffer needs flipping or
not in the interface and then in the client do a flip where necessary.

Thoughts?

Cheerio,

Rob


More information about the wayland-devel mailing list