summaryrefslogtreecommitdiffstats
path: root/opengl/libs
diff options
context:
space:
mode:
authorChristopher N. Hesse <raymanfx@gmail.com>2016-04-24 19:30:35 +0200
committerEthan Chen <intervigil@gmail.com>2016-04-27 10:18:32 -0700
commit3ce4ffc46e31f4dd7ca89da1af0c40086f51a01e (patch)
tree2c303c4fa0d0e91d7716af7f0b107dd88e5b453c /opengl/libs
parentec0faee33a521407bd7c0259b958ca27241677e1 (diff)
downloadframeworks_native-3ce4ffc46e31f4dd7ca89da1af0c40086f51a01e.zip
frameworks_native-3ce4ffc46e31f4dd7ca89da1af0c40086f51a01e.tar.gz
frameworks_native-3ce4ffc46e31f4dd7ca89da1af0c40086f51a01e.tar.bz2
surfaceflinger: Add support for Exynos BGRA mixer
Change-Id: Ibc9f784b35a7bd6d8cc6b13ff68b12418cce98c5
Diffstat (limited to 'opengl/libs')
-rw-r--r--opengl/libs/Android.mk4
-rw-r--r--opengl/libs/EGL/eglApi.cpp9
2 files changed, 13 insertions, 0 deletions
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk
index e952a38..870c2bd 100644
--- a/opengl/libs/Android.mk
+++ b/opengl/libs/Android.mk
@@ -65,6 +65,10 @@ ifneq ($(MAX_EGL_CACHE_SIZE),)
LOCAL_CFLAGS += -DMAX_EGL_CACHE_SIZE=$(MAX_EGL_CACHE_SIZE)
endif
+ifeq ($(BOARD_USE_BGRA_8888), true)
+ LOCAL_CFLAGS += -DUSE_BGRA_8888
+endif
+
LOCAL_REQUIRED_MODULES := $(egl.cfg_config_module)
egl.cfg_config_module :=
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 4d9eaf5..2f6bc79 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -462,8 +462,13 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
// modify the EGLconfig's format before setting the native window's
// format.
+#ifdef USE_BGRA_8888
+ // by default, just pick BGRA_8888
+ EGLint format = HAL_PIXEL_FORMAT_BGRA_8888;
+#else
// by default, just pick RGBA_8888
EGLint format = HAL_PIXEL_FORMAT_RGBA_8888;
+#endif
android_dataspace dataSpace = HAL_DATASPACE_UNKNOWN;
#if WORKAROUND_BUG_10194508
@@ -478,7 +483,11 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
cnx->egl.eglGetConfigAttrib(iDpy, config, EGL_ALPHA_SIZE, &a);
if (a > 0) {
// alpha-channel requested, there's really only one suitable format
+#ifdef USE_BGRA_8888
+ format = HAL_PIXEL_FORMAT_BGRA_8888;
+#else
format = HAL_PIXEL_FORMAT_RGBA_8888;
+#endif
} else {
EGLint r, g, b;
r = g = b = 0;