diff options
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/libs/Android.mk | 10 | ||||
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk index 18ad300..870c2bd 100644 --- a/opengl/libs/Android.mk +++ b/opengl/libs/Android.mk @@ -47,6 +47,12 @@ LOCAL_CFLAGS += -DEGL_TRACE=1 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 +ifeq ($(BOARD_EGL_WORKAROUND_BUG_10194508),true) + 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 @@ -59,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 cdec565..2f6bc79 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -462,15 +462,32 @@ 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 + 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) { // 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; @@ -484,6 +501,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")) { |