OSDN Git Service

libEGL: select pixel format by EGL_NATIVE_VISUAL_ID
authorChih-Wei Huang <cwhuang@linux.org.tw>
Mon, 4 Sep 2017 11:26:33 +0000 (19:26 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 12 Dec 2017 16:15:20 +0000 (00:15 +0800)
We need this workaround until Mesa supports HAL_PIXEL_FORMAT_RGBA_8888.

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 {