mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-06 21:55:41 +00:00
exynos: libEGL_mali: don't force BGRA8888 format when it's unneeded
Change-Id: I9cc318b7bb00c2efaf386bb2e75e99c275aaca7e
This commit is contained in:
parent
f54ba67557
commit
2ebf93df9d
1 changed files with 9 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue