compositor: Use GL_BGRA_EXT for glReadPixels in screenshooter
This needs GL_EXT_read_format_bgra.
This commit is contained in:
parent
9629fe3206
commit
f9247ddc31
|
@ -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");
|
||||
return -1;
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Reference in New Issue