[mutter] wayland-dma-buf: Use alpha-less pixel formats where appropriate



commit 9ededb9b3406dffadcdbdf40a845f8fac8960098
Author: Robert Mader <robert mader posteo de>
Date:   Fri Apr 2 11:08:54 2021 +0200

    wayland-dma-buf: Use alpha-less pixel formats where appropriate
    
    The XRGB/XBGR pixel formats do not set the cogl alpha bit. This
    allows for example `MetaShapedTexture` to use the fast opaque
    path for rendering and `MetaCullable` to detect whether a
    `MetaSurfaceActor` is opaque.
    
    Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1733
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1810>

 src/wayland/meta-wayland-dma-buf.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/wayland/meta-wayland-dma-buf.c b/src/wayland/meta-wayland-dma-buf.c
index 54400ffcd3..25e517a1c4 100644
--- a/src/wayland/meta-wayland-dma-buf.c
+++ b/src/wayland/meta-wayland-dma-buf.c
@@ -119,7 +119,7 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer  *buffer,
       cogl_format = COGL_PIXEL_FORMAT_ARGB_8888_PRE;
       break;
     case DRM_FORMAT_XRGB2101010:
-      cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010;
+      cogl_format = COGL_PIXEL_FORMAT_XRGB_2101010;
       break;
     case DRM_FORMAT_ARGB2101010:
       cogl_format = COGL_PIXEL_FORMAT_ARGB_2101010_PRE;
@@ -131,10 +131,14 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer  *buffer,
       cogl_format = COGL_PIXEL_FORMAT_RGB_565;
       break;
     case DRM_FORMAT_XBGR16161616F:
+      cogl_format = COGL_PIXEL_FORMAT_XBGR_FP_16161616;
+      break;
     case DRM_FORMAT_ABGR16161616F:
       cogl_format = COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE;
       break;
     case DRM_FORMAT_XRGB16161616F:
+      cogl_format = COGL_PIXEL_FORMAT_XRGB_FP_16161616;
+      break;
     case DRM_FORMAT_ARGB16161616F:
       cogl_format = COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE;
       break;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]