commit | 9affdbb5bd596b304c14176f2ebc298eb56f9d38 | [log] [tgz] |
---|---|---|
author | Googler <noreply@google.com> | Fri Jan 20 12:33:12 2023 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Fri Jan 20 12:38:22 2023 -0800 |
tree | a8423fad5715fbae17d8f7146cf9c0700795dbdb | |
parent | d91164f95f935c169f0ed0c029b329100cc9d758 [diff] |
Add eglGetCurrentContext() implementation in ShadowEGL14. PiperOrigin-RevId: 503500116
diff --git a/robolectric/src/test/java/org/robolectric/shadows/ShadowEGL14Test.java b/robolectric/src/test/java/org/robolectric/shadows/ShadowEGL14Test.java index e5d5c9d..4da4963 100644 --- a/robolectric/src/test/java/org/robolectric/shadows/ShadowEGL14Test.java +++ b/robolectric/src/test/java/org/robolectric/shadows/ShadowEGL14Test.java
@@ -17,6 +17,11 @@ @Config(minSdk = VERSION_CODES.LOLLIPOP) public final class ShadowEGL14Test { @Test + public void eglGetCurrentContext() { + assertThat(EGL14.eglGetCurrentContext()).isNotNull(); + } + + @Test public void eglGetDisplay() { assertThat(EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY)).isNotNull(); }
diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowEGL14.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowEGL14.java index 475607a..4f488b5 100644 --- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowEGL14.java +++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowEGL14.java
@@ -84,6 +84,11 @@ } @Implementation + protected static EGLContext eglGetCurrentContext() { + return createEglContext(3); + } + + @Implementation protected static boolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) { return true;