HYL_OK3568_LINUX/buildroot/package/enlightenment/0011-pixmap-Fix-alpha-error-for-drm-formats.patch
2025-05-10 21:49:39 +08:00

44 lines
1.3 KiB
Diff

From 438f21fcc62898d19d0619b420eb3a0578031e55 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Mon, 25 Jul 2022 10:46:43 +0800
Subject: [PATCH 11/11] pixmap: Fix alpha error for drm formats
Tested with chromium-ozone-wayland.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
src/bin/e_pixmap.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 3d9177f4a..f8c2a01ed 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -609,8 +609,8 @@ e_pixmap_refresh(E_Pixmap *cp)
switch (format)
{
- case DRM_FORMAT_ARGB8888:
case WL_SHM_FORMAT_ARGB8888:
+ case WL_SHM_FORMAT_ABGR8888:
case EGL_TEXTURE_RGBA:
cp->image_argb = EINA_TRUE;
break;
@@ -619,6 +619,13 @@ e_pixmap_refresh(E_Pixmap *cp)
break;
}
+ /* HACK: Check DRM fourcc for alpha channel */
+ if (buffer->dmabuf_buffer)
+ {
+ if ((format >> 24) == 'A' || ((format >> 16) & 0xFF) == 'A')
+ cp->image_argb = EINA_TRUE;
+ }
+
success = ((cp->w > 0) && (cp->h > 0));
}
#endif
--
2.20.1