exynos: libEGL_mali: don't force BGRA8888 format when it's unneeded

Change-Id: I9cc318b7bb00c2efaf386bb2e75e99c275aaca7e
This commit is contained in:
Shilin Victor 2019-03-05 23:57:37 +03:00
parent f54ba67557
commit 2ebf93df9d
1 changed files with 9 additions and 7 deletions

View File

@ -21,7 +21,8 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#ifdef SKIP_EGL_CONTEXT_DETACH
#if defined(NEEDS_NATIVE_WINDOW_FORMAT_FIX) || \
defined(SKIP_EGL_CONTEXT_DETACH)
static int debug_level = 0;
#endif
@ -50,14 +51,15 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
NativeWindowType window,
const EGLint *attrib_list) {
#ifdef NEEDS_NATIVE_WINDOW_FORMAT_FIX
int format, err;
window->query(window, NATIVE_WINDOW_FORMAT, &format);
int curFormat, newFormat, err;
window->query(window, NATIVE_WINDOW_FORMAT, &curFormat);
if (format == (int)HAL_PIXEL_FORMAT_RGBA_8888) {
format = (int)HAL_PIXEL_FORMAT_BGRA_8888;
err = window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format);
shim_eglGetConfigAttrib(dpy, config, EGL_NATIVE_VISUAL_ID, &newFormat);
if (curFormat != newFormat) {
err = window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, newFormat);
ALOGD_IF(debug_level > 0, "%s: curFormat=%d, newFormat=%d", __func__, curFormat, newFormat);
}
#endif
return shim_eglCreateWindowSurface(dpy, config, window, attrib_list);
}