OSDN Git Service

surfaceflinger: Add support for Exynos BGRA mixer
[android-x86/frameworks-native.git] / opengl / libs / EGL / eglApi.cpp
index 4d9eaf5..2f6bc79 100644 (file)
@@ -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;