From 519828c5b649e5e83f18444666f0672ab7852518 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Mon, 4 Sep 2017 19:26:33 +0800 Subject: [PATCH] libEGL: select pixel format by EGL_NATIVE_VISUAL_ID We need this workaround until Mesa supports HAL_PIXEL_FORMAT_RGBA_8888. --- opengl/libs/EGL/eglApi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 94dfe6a9de..01eeb6489d 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -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 { -- 2.11.0