EGL: Properly strip out unknown attributes
Introduced a bug when adding SMPTE support.
EGL wrapper needs to strip out color space extension information that
the driver doesn't recognize to prevent calls into the driver from
failing. e.g. EGL_GL_COLORSPACE_DISPLAY_P3_EXT or SMPTE extension
attributes such as EGL_SMPTE2086_WHITE_POINT_X_EXT.
Test: adb -d shell am start -n \
com.drawelements.deqp/android.app.NativeActivity \
-e cmdLine '"deqp --deqp-case=dEQP-EGL.functional.hdr_color.* \
--deqp-log-filename=/sdcard/dEQP-Log.qpa"'
Bug: b/72705818, b/72753050
Change-Id: I7a4bb9579da04783952aaf49d96f9d67460390db
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 484e0ba..26ae13d 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -513,11 +513,11 @@
found = true;
}
}
- if (found && dp->haveExtension("EGL_KHR_gl_colorspace")) {
- stripped = true;
- } else {
+ if (found || !dp->haveExtension("EGL_KHR_gl_colorspace")) {
stripped_attrib_list.push_back(attr[0]);
stripped_attrib_list.push_back(attr[1]);
+ } else {
+ stripped = true;
}
}
break;