Android: Prepare moving EglBase10/EglBase14 from to API to src
BUG=webrtc:7172 Review-Url: https://codereview.webrtc.org/2826063002 Cr-Commit-Position: refs/heads/master@{#17807}
This commit is contained in:
@ -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.
|
||||
|
||||
Reference in New Issue
Block a user