wayland/dma-buf: Add support for BGR_8888 formats

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1999>
This commit is contained in:
Erfan Abdi 2021-09-12 11:02:00 +04:30 committed by Marge Bot
parent 9bd2c5c6f2
commit 922878acc6

View File

@ -115,9 +115,15 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
case DRM_FORMAT_XRGB8888:
cogl_format = COGL_PIXEL_FORMAT_RGB_888;
break;
case DRM_FORMAT_XBGR8888:
cogl_format = COGL_PIXEL_FORMAT_BGR_888;
break;
case DRM_FORMAT_ARGB8888:
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888_PRE;
break;
case DRM_FORMAT_ABGR8888:
cogl_format = COGL_PIXEL_FORMAT_ABGR_8888_PRE;
break;
case DRM_FORMAT_XRGB2101010:
cogl_format = COGL_PIXEL_FORMAT_XRGB_2101010;
break;
@ -713,7 +719,9 @@ dma_buf_bind (struct wl_client *client,
wl_resource_set_implementation (resource, &dma_buf_implementation,
compositor, NULL);
send_modifiers (resource, DRM_FORMAT_ARGB8888);
send_modifiers (resource, DRM_FORMAT_ABGR8888);
send_modifiers (resource, DRM_FORMAT_XRGB8888);
send_modifiers (resource, DRM_FORMAT_XBGR8888);
send_modifiers (resource, DRM_FORMAT_ARGB2101010);
send_modifiers (resource, DRM_FORMAT_ABGR2101010);
send_modifiers (resource, DRM_FORMAT_XRGB2101010);