File mutter-iconcache-Support-RGB16_565-format-for-16-bit-color-.patch of Package mutter.10324

From ac29ffebc3cbc4aa33e2f4685039496d2cff6170 Mon Sep 17 00:00:00 2001
From: Vasilis Liaskovitis <vliaskovitis@suse.com>
Date: Thu, 6 Jul 2017 10:26:57 +0200
Subject: [PATCH] iconcache: Support RGB16_565 format for 16-bit color depth
 sessions

Add an RGB16_565 XRenderPictformat. Otherwise, 16-bit depth sessions
terminate in standard_pict_format_for_depth().

https://bugzilla.gnome.org/show_bug.cgi?id=781704
---
 src/x11/iconcache.c | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

Index: mutter-3.26.0/src/x11/iconcache.c
===================================================================
--- mutter-3.26.0.orig/src/x11/iconcache.c
+++ mutter-3.26.0/src/x11/iconcache.c
@@ -304,10 +304,43 @@ standard_pict_format_for_depth (int dept
     }
 }
 
+static XRenderPictFormat RGB16_565_Format =
+/* PictRGB16_565 */
+{
+     {
+	 0,			    /* id */
+	 PictTypeDirect,		    /* type */
+	 16,			    /* depth */
+	 {			    /* direct */
+	     11,		    /* direct.red */
+	     0x1f,		    /* direct.redMask */
+	     5,			    /* direct.green */
+	     0x3f,		    /* direct.greenMask */
+	     0,			    /* direct.blue */
+	     0x1f,		    /* direct.blueMask */
+	     0,			    /* direct.alpha */
+	     0x00,		    /* direct.alphaMask */
+	 },
+	 0,			    /* colormap */
+     },
+     PictFormatType |
+     PictFormatDepth |
+     PictFormatRed |
+     PictFormatRedMask |
+     PictFormatGreen |
+     PictFormatGreenMask |
+     PictFormatBlue |
+     PictFormatBlueMask |
+     PictFormatAlphaMask,
+};
+
 static XRenderPictFormat *
 pict_format_for_depth (Display *xdisplay, int depth)
 {
-  return XRenderFindStandardFormat (xdisplay, standard_pict_format_for_depth (depth));
+  if (depth != 16)
+    return XRenderFindStandardFormat (xdisplay, standard_pict_format_for_depth (depth));
+  else
+    return &RGB16_565_Format;
 }
 
 static cairo_surface_t *
openSUSE Build Service is sponsored by