OSDN Git Service

libEGL: select pixel format by EGL_NATIVE_VISUAL_ID
[android-x86/frameworks-native.git] / opengl / libs / EGL / eglApi.cpp
index 94dfe6a..01eeb64 100644 (file)
@@ -655,7 +655,8 @@ void getNativePixelFormat(EGLDisplay dpy, egl_connection_t* cnx, EGLConfig confi
         if (componentType == EGL_COLOR_COMPONENT_TYPE_FIXED_EXT) {
             if (colorDepth > 24) {
                 format = HAL_PIXEL_FORMAT_RGBA_1010102;
-            } else {
+            } else if (!cnx->egl.eglGetConfigAttrib(dpy, config, EGL_NATIVE_VISUAL_ID, &format)) {
+                ALOGE("eglGetConfigAttrib(EGL_NATIVE_VISUAL_ID) failed: %#x", eglGetError());
                 format = HAL_PIXEL_FORMAT_RGBA_8888;
             }
         } else {