simple-egl: only force config buffer size for 16bpp

Constraining the buffer size of an EGLConfig to 32 means that
the sum of red, green, blue, and alpha channels must equal 32.
This constraint prevented weston-simple-egl from picking an
RGBX pixel format when an opaque surface was asked for, since
the typical RGBX pixel formats have buffer sizes of 30, 24,
and 16.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
dev
Manuel Stoeckl 3 years ago committed by Marius Vlad
parent 4564b799b8
commit b4e70a49ef
  1. 4
      clients/simple-egl.c

@ -181,7 +181,7 @@ init_egl(struct display *display, struct window *window)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
eglGetConfigAttrib(display->egl.dpy, eglGetConfigAttrib(display->egl.dpy,
configs[i], EGL_BUFFER_SIZE, &size); configs[i], EGL_BUFFER_SIZE, &size);
if (window->buffer_size == size) { if (window->buffer_size == 0 || window->buffer_size == size) {
display->egl.conf = configs[i]; display->egl.conf = configs[i];
break; break;
} }
@ -818,7 +818,7 @@ main(int argc, char **argv)
window.geometry.width = 250; window.geometry.width = 250;
window.geometry.height = 250; window.geometry.height = 250;
window.window_size = window.geometry; window.window_size = window.geometry;
window.buffer_size = 32; window.buffer_size = 0;
window.frame_sync = 1; window.frame_sync = 1;
window.delay = 0; window.delay = 0;

Loading…
Cancel
Save