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
c672ebf905
commit
5c261a7416
1 changed files with 9 additions and 7 deletions
|
@ -21,7 +21,8 @@
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
#include <EGL/eglext.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;
|
static int debug_level = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -50,14 +51,15 @@ EGLSurface eglCreateWindowSurface( EGLDisplay dpy, EGLConfig config,
|
||||||
NativeWindowType window,
|
NativeWindowType window,
|
||||||
const EGLint *attrib_list) {
|
const EGLint *attrib_list) {
|
||||||
#ifdef NEEDS_NATIVE_WINDOW_FORMAT_FIX
|
#ifdef NEEDS_NATIVE_WINDOW_FORMAT_FIX
|
||||||
int format, err;
|
int curFormat, newFormat, err;
|
||||||
window->query(window, NATIVE_WINDOW_FORMAT, &format);
|
window->query(window, NATIVE_WINDOW_FORMAT, &curFormat);
|
||||||
|
|
||||||
if (format == (int)HAL_PIXEL_FORMAT_RGBA_8888) {
|
shim_eglGetConfigAttrib(dpy, config, EGL_NATIVE_VISUAL_ID, &newFormat);
|
||||||
format = (int)HAL_PIXEL_FORMAT_BGRA_8888;
|
|
||||||
err = window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format);
|
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
|
#endif
|
||||||
return shim_eglCreateWindowSurface(dpy, config, window, attrib_list);
|
return shim_eglCreateWindowSurface(dpy, config, window, attrib_list);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue