This needs GL_EXT_read_format_bgra.
@ -2321,6 +2321,11 @@ weston_compositor_init(struct weston_compositor *ec, struct wl_display *display)
return -1;
}
if (!strstr(extensions, "GL_EXT_read_format_bgra")) {
fprintf(stderr, "GL_EXT_read_format_bgra not available\n");
extensions =
(const char *) eglQueryString(ec->display, EGL_EXTENSIONS);
if (strstr(extensions, "EGL_WL_bind_wayland_display"))
@ -62,7 +62,7 @@ screenshooter_shoot(struct wl_client *client,
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, output->current->width, output->current->height,
GL_RGBA, GL_UNSIGNED_BYTE, tmp);
GL_BGRA_EXT, GL_UNSIGNED_BYTE, tmp);
d = wl_shm_buffer_get_data(buffer);
s = tmp + stride * (buffer->height - 1);