Skip to content

Commit 3013feb

Browse files
Add test for eglCreateContext with EGL_TELEMETRY_HINT_ANDROID
Verify that eglCreateContext works when EGL_TELEMETRY_HINT_ANDROID is pass in the attribute list Test: presubmits Bug: 361291185 Flag: EXEMPT adding test Change-Id: Ib41e54330179b85aff99985deda796f9b4728c80
1 parent dcff137 commit 3013feb

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

opengl/tests/EGLTest/EGL_test.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,30 @@ TEST_F(EGLTest, EGLNoConfigContext) {
765765
}
766766
}
767767

768+
// Verify that eglCreateContext works when EGL_TELEMETRY_HINT_ANDROID is used with
769+
// NO_HINT = 0, SKIP_TELEMETRY = 1 and an invalid of value of 2
770+
TEST_F(EGLTest, EGLContextTelemetryHintExt) {
771+
for (int i = 0; i < 3; i++) {
772+
EGLConfig config;
773+
get8BitConfig(config);
774+
std::vector<EGLint> contextAttributes;
775+
contextAttributes.reserve(4);
776+
contextAttributes.push_back(EGL_TELEMETRY_HINT_ANDROID);
777+
contextAttributes.push_back(i);
778+
contextAttributes.push_back(EGL_NONE);
779+
contextAttributes.push_back(EGL_NONE);
780+
781+
EGLContext eglContext = eglCreateContext(mEglDisplay, config, EGL_NO_CONTEXT,
782+
contextAttributes.data());
783+
EXPECT_NE(EGL_NO_CONTEXT, eglContext);
784+
EXPECT_EQ(EGL_SUCCESS, eglGetError());
785+
786+
if (eglContext != EGL_NO_CONTEXT) {
787+
eglDestroyContext(mEglDisplay, eglContext);
788+
}
789+
}
790+
}
791+
768792
// Emulate what a native application would do to create a
769793
// 10:10:10:2 surface.
770794
TEST_F(EGLTest, EGLConfig1010102) {

0 commit comments

Comments
 (0)