From a615e17ec0ad7739b367034473ab3312299e70da Mon Sep 17 00:00:00 2001 From: deadbeef Date: Thu, 25 May 2017 10:11:25 -0700 Subject: [PATCH] Allow constructing an EglBase from an existing shared EGLContext. BUG=None Review-Url: https://codereview.webrtc.org/2885163003 Cr-Commit-Position: refs/heads/master@{#18266} --- webrtc/sdk/android/api/org/webrtc/EglBase.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/webrtc/sdk/android/api/org/webrtc/EglBase.java b/webrtc/sdk/android/api/org/webrtc/EglBase.java index 3e221c2f47..619022c770 100644 --- a/webrtc/sdk/android/api/org/webrtc/EglBase.java +++ b/webrtc/sdk/android/api/org/webrtc/EglBase.java @@ -115,6 +115,15 @@ public abstract class EglBase { return new EglBase10(null /* shaderContext */, configAttributes); } + /** + * Explicitly create a root EGl 1.0 context with the specified config attributes + * and shared context. + */ + public static EglBase createEgl10( + javax.microedition.khronos.egl.EGLContext sharedContext, int[] configAttributes) { + return new EglBase10(new EglBase10.Context(sharedContext), configAttributes); + } + /** * Explicitly create a root EGl 1.4 context with the specified config attributes. */ @@ -122,6 +131,15 @@ public abstract class EglBase { return new EglBase14(null /* shaderContext */, configAttributes); } + /** + * Explicitly create a root EGl 1.4 context with the specified config attributes + * and shared context. + */ + public static EglBase createEgl14( + android.opengl.EGLContext sharedContext, int[] configAttributes) { + return new EglBase14(new EglBase14.Context(sharedContext), configAttributes); + } + public abstract void createSurface(Surface surface); // Create EGLSurface from the Android SurfaceTexture.