OSDN Git Service

Revert "egl: Remove old tuna BGRA vs RGBA workaround."
authorEthan Chen <intervigil@gmail.com>
Thu, 15 Oct 2015 20:50:10 +0000 (13:50 -0700)
committerSteve Kondik <steve@cyngn.com>
Thu, 1 Sep 2016 06:33:23 +0000 (23:33 -0700)
This reverts commit 733a80754786d39cdc0fee09509b194472c320bc.

Change-Id: Ifb41720ed020489892a667914ea3bd3f1ac6504e

opengl/libs/Android.mk
opengl/libs/EGL/eglApi.cpp

index eb86860..a1d8bf0 100644 (file)
@@ -45,6 +45,9 @@ LOCAL_CFLAGS += -fvisibility=hidden
 ifeq ($(BOARD_ALLOW_EGL_HIBERNATION),true)
   LOCAL_CFLAGS += -DBOARD_ALLOW_EGL_HIBERNATION
 endif
+ifeq ($(TARGET_BOARD_PLATFORM), omap4)
+  LOCAL_CFLAGS += -DWORKAROUND_BUG_10194508=1
+endif
 ifneq ($(MAX_EGL_CACHE_ENTRY_SIZE),)
   LOCAL_CFLAGS += -DMAX_EGL_CACHE_ENTRY_SIZE=$(MAX_EGL_CACHE_ENTRY_SIZE)
 endif
index e793852..3c00fc9 100644 (file)
@@ -474,6 +474,14 @@ EGLSurface eglCreateWindowSurface(  EGLDisplay dpy, EGLConfig config,
         EGLint format = HAL_PIXEL_FORMAT_RGBA_8888;
         android_dataspace dataSpace = HAL_DATASPACE_UNKNOWN;
 
+#if WORKAROUND_BUG_10194508
+        if (!cnx->egl.eglGetConfigAttrib(iDpy, config, EGL_NATIVE_VISUAL_ID,
+                &format)) {
+            ALOGE("eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID) failed: %#x",
+                    eglGetError());
+            format = 0;
+        }
+#else
         EGLint a = 0;
         cnx->egl.eglGetConfigAttrib(iDpy, config, EGL_ALPHA_SIZE, &a);
         if (a > 0) {
@@ -492,6 +500,7 @@ EGLSurface eglCreateWindowSurface(  EGLDisplay dpy, EGLConfig config,
                 format = HAL_PIXEL_FORMAT_RGBX_8888;
             }
         }
+#endif
 
         // now select a corresponding sRGB format if needed
         if (attrib_list && dp->haveExtension("EGL_KHR_gl_colorspace")) {