diff options
Diffstat (limited to 'opengl/libs/EGL/eglApi.cpp')
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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; |