summaryrefslogtreecommitdiffstats
path: root/exynos4
diff options
context:
space:
mode:
authorShilin Victor <chrono.monochrome@gmail.com>2019-03-05 23:57:37 +0300
committerShilin Victor <chrono.monochrome@gmail.com>2019-03-05 23:59:31 +0300
commit5c261a7416f12863fa2bfdac327614c03ce47161 (patch)
tree55a3febbbfc824e63b07d64a01237ff950ab5768 /exynos4
parentc672ebf905154f0a5f85cd0bcfd067084fcc3b71 (diff)
downloadhardware_samsung-5c261a7416f12863fa2bfdac327614c03ce47161.tar.gz
hardware_samsung-5c261a7416f12863fa2bfdac327614c03ce47161.tar.bz2
hardware_samsung-5c261a7416f12863fa2bfdac327614c03ce47161.zip
exynos: libEGL_mali: don't force BGRA8888 format when it's unneeded
Change-Id: I9cc318b7bb00c2efaf386bb2e75e99c275aaca7e
Diffstat (limited to 'exynos4')
-rw-r--r--exynos4/hal/libEGL_mali/eglApi.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/exynos4/hal/libEGL_mali/eglApi.cpp b/exynos4/hal/libEGL_mali/eglApi.cpp
index bbd6aa4..7e45be2 100644
--- a/exynos4/hal/libEGL_mali/eglApi.cpp
+++ b/exynos4/hal/libEGL_mali/eglApi.cpp
@@ -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);
}