summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKra1o5 <kra1o5x@gmail.com>2015-10-14 18:22:42 +0200
committerKra1o5 <kra1o5x@gmail.com>2015-10-14 18:23:23 +0200
commit8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1 (patch)
treea6d1850ab7045532fa47c9b6caad257f7dd23143
parentAdd TW_IGNORE_ABS_MT_TRACKING_ID (diff)
downloadandroid_bootable_recovery-8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1.tar
android_bootable_recovery-8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1.tar.gz
android_bootable_recovery-8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1.tar.bz2
android_bootable_recovery-8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1.tar.lz
android_bootable_recovery-8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1.tar.xz
android_bootable_recovery-8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1.tar.zst
android_bootable_recovery-8499b08b9a16aa0e9e8e90582e8fcfd92b1ae3b1.zip
-rw-r--r--minui/Android.mk6
-rw-r--r--minui/graphics.c12
-rw-r--r--minui/graphics_overlay.c2
-rw-r--r--minuitwrp/Android.mk3
-rw-r--r--minuitwrp/graphics.c15
-rw-r--r--minuitwrp/graphics_overlay.c2
6 files changed, 40 insertions, 0 deletions
diff --git a/minui/Android.mk b/minui/Android.mk
index 7d8e3a7f3..d21f1304a 100644
--- a/minui/Android.mk
+++ b/minui/Android.mk
@@ -41,6 +41,9 @@ LOCAL_MODULE := libminui
# ordinary characters in this context). Strip double-quotes from the
# value so that either will work.
+ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBA_8888)
+ LOCAL_CFLAGS += -DRECOVERY_RGBA
+endif
ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
LOCAL_CFLAGS += -DRECOVERY_RGBX
endif
@@ -107,6 +110,9 @@ LOCAL_SHARED_LIBRARIES := libpng libpixelflinger
# ordinary characters in this context). Strip double-quotes from the
# value so that either will work.
+ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBA_8888)
+ LOCAL_CFLAGS += -DRECOVERY_RGBA
+endif
ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
LOCAL_CFLAGS += -DRECOVERY_RGBX
endif
diff --git a/minui/graphics.c b/minui/graphics.c
index cce02a963..580af297a 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -42,6 +42,9 @@
#if defined(RECOVERY_BGRA)
#define PIXEL_FORMAT GGL_PIXEL_FORMAT_BGRA_8888
#define PIXEL_SIZE 4
+#elif defined(RECOVERY_RGBA)
+#define PIXEL_FORMAT GGL_PIXEL_FORMAT_RGBA_8888
+#define PIXEL_SIZE 4
#elif defined(RECOVERY_RGBX)
#define PIXEL_FORMAT GGL_PIXEL_FORMAT_RGBX_8888
#define PIXEL_SIZE 4
@@ -111,6 +114,15 @@ static int get_framebuffer(GGLSurface *fb)
vi.blue.length = 8;
vi.transp.offset = 0;
vi.transp.length = 8;
+ } else if (PIXEL_FORMAT == GGL_PIXEL_FORMAT_RGBA_8888) {
+ vi.red.offset = 0;
+ vi.red.length = 8;
+ vi.green.offset = 8;
+ vi.green.length = 8;
+ vi.blue.offset = 16;
+ vi.blue.length = 8;
+ vi.transp.offset = 24;
+ vi.transp.length = 8;
} else if (PIXEL_FORMAT == GGL_PIXEL_FORMAT_RGBX_8888) {
vi.red.offset = 24;
vi.red.length = 8;
diff --git a/minui/graphics_overlay.c b/minui/graphics_overlay.c
index d793b57e6..c42e9c18a 100644
--- a/minui/graphics_overlay.c
+++ b/minui/graphics_overlay.c
@@ -72,6 +72,8 @@ static int map_mdp_pixel_format()
int format = MDP_RGB_565;
#if defined(RECOVERY_BGRA)
format = MDP_BGRA_8888;
+#elif defined(RECOVERY_RGBA)
+ format = MDP_RGBA_8888;
#elif defined(RECOVERY_RGBX)
format = MDP_RGBA_8888;
#endif
diff --git a/minuitwrp/Android.mk b/minuitwrp/Android.mk
index 76b4024cc..56fe20011 100644
--- a/minuitwrp/Android.mk
+++ b/minuitwrp/Android.mk
@@ -62,6 +62,9 @@ ifeq ($(TWRP_EVENT_LOGGING), true)
LOCAL_CFLAGS += -D_EVENT_LOGGING
endif
+ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBA_8888)
+ LOCAL_CFLAGS += -DRECOVERY_RGBA
+endif
ifeq ($(subst ",,$(TARGET_RECOVERY_PIXEL_FORMAT)),RGBX_8888)
LOCAL_CFLAGS += -DRECOVERY_RGBX
endif
diff --git a/minuitwrp/graphics.c b/minuitwrp/graphics.c
index 04c41fb54..4b4e5c679 100644
--- a/minuitwrp/graphics.c
+++ b/minuitwrp/graphics.c
@@ -43,6 +43,10 @@
#define PIXEL_FORMAT GGL_PIXEL_FORMAT_BGRA_8888
#define PIXEL_SIZE 4
#endif
+#ifdef RECOVERY_RGBA
+#define PIXEL_FORMAT GGL_PIXEL_FORMAT_RGBA_8888
+#define PIXEL_SIZE 4
+#endif
#ifdef RECOVERY_RGBX
#define PIXEL_FORMAT GGL_PIXEL_FORMAT_RGBX_8888
#define PIXEL_SIZE 4
@@ -198,6 +202,17 @@ static int get_framebuffer(GGLSurface *fb)
vi.blue.length = 8;
vi.transp.offset = 0;
vi.transp.length = 8;
+ } else if (PIXEL_FORMAT == GGL_PIXEL_FORMAT_RGBA_8888) {
+ fprintf(stderr, "Pixel format: RGBA_8888\n");
+ if (PIXEL_SIZE != 4) fprintf(stderr, "E: Pixel Size mismatch!\n");
+ vi.red.offset = 0;
+ vi.red.length = 8;
+ vi.green.offset = 8;
+ vi.green.length = 8;
+ vi.blue.offset = 16;
+ vi.blue.length = 8;
+ vi.transp.offset = 24;
+ vi.transp.length = 8;
} else if (PIXEL_FORMAT == GGL_PIXEL_FORMAT_RGBX_8888) {
fprintf(stderr, "Pixel format: RGBX_8888\n");
if (PIXEL_SIZE != 4) fprintf(stderr, "E: Pixel Size mismatch!\n");
diff --git a/minuitwrp/graphics_overlay.c b/minuitwrp/graphics_overlay.c
index 80e64d72b..723ffa2d4 100644
--- a/minuitwrp/graphics_overlay.c
+++ b/minuitwrp/graphics_overlay.c
@@ -75,6 +75,8 @@ static int map_mdp_pixel_format()
int format = MDP_RGB_565;
#if defined(RECOVERY_BGRA)
format = MDP_BGRA_8888;
+#elif defined(RECOVERY_RGBA)
+ format = MDP_RGBA_8888;
#elif defined(RECOVERY_RGBX)
format = MDP_RGBA_8888;
#endif