diff options
-rw-r--r-- | opengl/libagl/egl.cpp | 2 | ||||
-rw-r--r-- | opengl/libs/EGL/Loader.cpp | 7 | ||||
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 19 | ||||
-rw-r--r-- | services/surfaceflinger/RenderEngine/RenderEngine.cpp | 10 |
4 files changed, 19 insertions, 19 deletions
diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index 593d0c2..ee790c9 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -1373,7 +1373,7 @@ static EGLSurface createPbufferSurface(EGLDisplay dpy, EGLConfig config, int32_t w = 0; int32_t h = 0; - while (attrib_list[0]) { + while (attrib_list[0] != EGL_NONE) { if (attrib_list[0] == EGL_WIDTH) w = attrib_list[1]; if (attrib_list[0] == EGL_HEIGHT) h = attrib_list[1]; attrib_list+=2; diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp index 1fcc048..19cc1a7 100644 --- a/opengl/libs/EGL/Loader.cpp +++ b/opengl/libs/EGL/Loader.cpp @@ -86,7 +86,12 @@ checkGlesEmulationStatus(void) char prop[PROPERTY_VALUE_MAX]; int result = -1; - /* First, check for qemu=1 */ + /* Check first if the device does not support hardware rendering */ + property_get("ro.libagl",prop,"0"); + if(atoi(prop) == 1) + return 0; + + /* Then, check for qemu=1 */ property_get("ro.kernel.qemu",prop,"0"); if (atoi(prop) != 1) return -1; diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 2f6bc79..dc8dc9a 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -462,13 +462,7 @@ 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 + EGLint format; android_dataspace dataSpace = HAL_DATASPACE_UNKNOWN; #if WORKAROUND_BUG_10194508 @@ -483,11 +477,12 @@ 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 + if (!cnx->egl.eglGetConfigAttrib(iDpy, config, EGL_NATIVE_VISUAL_ID, + &format)) { + ALOGE("eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID) failed: %#x", + eglGetError()); + format = HAL_PIXEL_FORMAT_RGBA_8888; + } } else { EGLint r, g, b; r = g = b = 0; diff --git a/services/surfaceflinger/RenderEngine/RenderEngine.cpp b/services/surfaceflinger/RenderEngine/RenderEngine.cpp index cb1d14c..ba94030 100644 --- a/services/surfaceflinger/RenderEngine/RenderEngine.cpp +++ b/services/surfaceflinger/RenderEngine/RenderEngine.cpp @@ -378,11 +378,11 @@ static status_t selectEGLConfig(EGLDisplay display, EGLint format, attribs[EGL_RECORDABLE_ANDROID] = EGL_TRUE; attribs[EGL_SURFACE_TYPE] = EGL_WINDOW_BIT|EGL_PBUFFER_BIT; attribs[EGL_FRAMEBUFFER_TARGET_ANDROID] = EGL_TRUE; - attribs[EGL_RED_SIZE] = 8; - attribs[EGL_GREEN_SIZE] = 8; - attribs[EGL_BLUE_SIZE] = 8; - wantedAttribute = EGL_NONE; - wantedAttributeValue = EGL_NONE; + attribs[EGL_RED_SIZE] = 5; + attribs[EGL_GREEN_SIZE] = 6; + attribs[EGL_BLUE_SIZE] = 5; + wantedAttribute = EGL_NATIVE_VISUAL_ID; + wantedAttributeValue = format; } else { // if no renderable type specified, fallback to a simplified query wantedAttribute = EGL_NATIVE_VISUAL_ID; |