Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: webrtc/sdk/android/api/org/webrtc/EglBase.java

Issue 2826063002: Android: Prepare moving EglBase10/EglBase14 from to API to src (Closed)
Patch Set: Rename createEgl to createEgl10 Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/sdk/android/api/org/webrtc/EglRenderer.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | webrtc/sdk/android/api/org/webrtc/EglRenderer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698