| Index: webrtc/sdk/android/api/org/webrtc/EglBase.java
|
| diff --git a/webrtc/sdk/android/api/org/webrtc/EglBase.java b/webrtc/sdk/android/api/org/webrtc/EglBase.java
|
| index 2c0d1e928a8fb2213c0867374022c8bae22792f0..3e221c2f478d368cca0f1c3534dc15df8c55b740 100644
|
| --- a/webrtc/sdk/android/api/org/webrtc/EglBase.java
|
| +++ b/webrtc/sdk/android/api/org/webrtc/EglBase.java
|
| @@ -80,8 +80,11 @@ public abstract class EglBase {
|
| };
|
| // clang-format on
|
|
|
| - // Create a new context with the specified config attributes, sharing data with sharedContext.
|
| - // |sharedContext| can be null.
|
| + /**
|
| + * Create a new context with the specified config attributes, sharing data with |sharedContext|.
|
| + * If |sharedContext| is null, a root context is created. This function will try to create an EGL
|
| + * 1.4 context if possible, and an EGL 1.0 context otherwise.
|
| + */
|
| public static EglBase create(Context sharedContext, int[] configAttributes) {
|
| return (EglBase14.isEGL14Supported()
|
| && (sharedContext == null || sharedContext instanceof EglBase14.Context))
|
| @@ -89,14 +92,36 @@ public abstract class EglBase {
|
| : new EglBase10((EglBase10.Context) sharedContext, configAttributes);
|
| }
|
|
|
| + /**
|
| + * Helper function for creating a plain root context. This function will try to create an EGL 1.4
|
| + * context if possible, and an EGL 1.0 context otherwise.
|
| + */
|
| public static EglBase create() {
|
| - return create(null, CONFIG_PLAIN);
|
| + return create(null /* shaderContext */, CONFIG_PLAIN);
|
| }
|
|
|
| + /**
|
| + * Helper function for creating a plain context, sharing data with |sharedContext|. This function
|
| + * will try to create an EGL 1.4 context if possible, and an EGL 1.0 context otherwise.
|
| + */
|
| public static EglBase create(Context sharedContext) {
|
| return create(sharedContext, CONFIG_PLAIN);
|
| }
|
|
|
| + /**
|
| + * Explicitly create a root EGl 1.0 context with the specified config attributes.
|
| + */
|
| + public static EglBase createEgl10(int[] configAttributes) {
|
| + return new EglBase10(null /* shaderContext */, configAttributes);
|
| + }
|
| +
|
| + /**
|
| + * Explicitly create a root EGl 1.4 context with the specified config attributes.
|
| + */
|
| + public static EglBase createEgl14(int[] configAttributes) {
|
| + return new EglBase14(null /* shaderContext */, configAttributes);
|
| + }
|
| +
|
| public abstract void createSurface(Surface surface);
|
|
|
| // Create EGLSurface from the Android SurfaceTexture.
|
|
|