Ignore EGL_SWAP_BEHAVIOR_PRESERVED_BIT on low API version
Some old APIs always try to ask for a surface with
EGL_SWAP_BEHAVIOR_PRESERVED_BIT, but this is never supported on the
host.
Now for API<=19, we ignore this bit.
Change-Id: I627915b5c4c3e18c1b8ae01925589ce67389daed
diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
index 1e51809..64a9bcf 100644
--- a/system/egl/egl.cpp
+++ b/system/egl/egl.cpp
@@ -756,11 +756,11 @@
attribs_size++; //for the terminating EGL_NONE
}
- // API 16 passes EGL_SWAP_BEHAVIOR_PRESERVED_BIT to surface type,
+ // API 19 passes EGL_SWAP_BEHAVIOR_PRESERVED_BIT to surface type,
// while the host never supports it.
// We remove the bit here.
EGLint* local_attrib_list = NULL;
- if (PLATFORM_SDK_VERSION <= 16) {
+ if (PLATFORM_SDK_VERSION <= 19) {
local_attrib_list = new EGLint[attribs_size];
memcpy(local_attrib_list, attrib_list, attribs_size * sizeof(EGLint));
EGLint* local_attrib_p = local_attrib_list;