| Modifier and Type | Field and Description |
|---|---|
static int |
FLAG_RECORDABLE
Constructor flag: surface must be recordable.
|
static int |
FLAG_TRY_GLES3
Constructor flag: ask for GLES3, fall back to GLES2 if not available.
|
| Modifier | Constructor and Description |
|---|---|
protected |
EglCore()
Prepares EGL display and context.
|
protected |
EglCore(java.lang.Object sharedContext,
int flags)
Prepares EGL display and context.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
_isCurrent(android.opengl.EGLSurface eglSurface) |
protected void |
_makeCurrent(android.opengl.EGLSurface eglSurface)
Makes our EGL context current, using the supplied surface for both "draw" and "read".
|
protected void |
_makeCurrent(android.opengl.EGLSurface drawSurface,
android.opengl.EGLSurface readSurface)
Makes our EGL context current, using the supplied "draw" and "read" surfaces.
|
int |
_querySurface(android.opengl.EGLSurface eglSurface,
int what)
Performs a simple surface query.
|
void |
_setPresentationTime(android.opengl.EGLSurface eglSurface,
long nsecs)
Sends the presentation time stamp to EGL.
|
protected android.opengl.EGLSurface |
createOffscreenSurface(int width,
int height)
Creates an EGL surface associated with an offscreen buffer.
|
IEglSurfaceBase |
createSurfaceBase() |
protected android.opengl.EGLSurface |
createWindowSurface(java.lang.Object surface)
Creates an EGL surface associated with a Surface.
|
IWindowSurface |
createWindowSurface(android.view.Surface surface,
boolean releaseSurface) |
IWindowSurface |
createWindowSurface(android.view.SurfaceHolder holder,
boolean releaseSurace) |
IWindowSurface |
createWindowSurface(android.graphics.SurfaceTexture surfaceTexture) |
protected void |
finalize() |
android.opengl.EGLContext |
getEGLContext() |
int |
getGlVersion()
Returns the GLES version this context is configured for (currently 2 or 3).
|
boolean |
isCurrent(android.opengl.EGLSurface eglSurface)
Returns true if our context and the specified surface are current.
|
boolean |
isCurrent(IEglSurfaceBase eglSfBase) |
static void |
logCurrent(java.lang.String msg)
Writes the current display, context, and surface to the log.
|
void |
makeCurrent(IEglSurfaceBase eglSfBase) |
void |
makeCurrent(IEglSurfaceBase drawSurface,
IEglSurfaceBase readSurface) |
void |
makeNothingCurrent()
Makes no context current.
|
java.lang.String |
queryString(int what)
Queries a string value.
|
int |
querySurface(android.opengl.EGLSurface eglSurface,
int what)
Performs a simple surface query.
|
int |
querySurface(IEglSurfaceBase eglSfBase,
int what) |
void |
release()
Discards all resources held by this class, notably the EGL context.
|
protected void |
releaseSurface(android.opengl.EGLSurface eglSurface)
Destroys the specified surface.
|
void |
setPresentationTime(IEglSurfaceBase eglSfBase,
long nsecs) |
boolean |
swapBuffers(android.opengl.EGLSurface eglSurface)
Calls eglSwapBuffers.
|
boolean |
swapBuffers(IEglSurfaceBase eglSfBase) |
public static final int FLAG_RECORDABLE
public static final int FLAG_TRY_GLES3
protected EglCore()
Equivalent to EglCore(null, 0).
protected EglCore(java.lang.Object sharedContext,
int flags)
sharedContext - The context to share, or null if sharing is not desired.flags - Configuration bit flags, e.g. FLAG_RECORDABLE.public void release()
On completion, no context will be current.
public void makeCurrent(IEglSurfaceBase eglSfBase)
makeCurrent in interface IEglCorepublic void makeCurrent(IEglSurfaceBase drawSurface, IEglSurfaceBase readSurface)
makeCurrent in interface IEglCorepublic boolean swapBuffers(IEglSurfaceBase eglSfBase)
swapBuffers in interface IEglCorepublic void setPresentationTime(IEglSurfaceBase eglSfBase, long nsecs)
setPresentationTime in interface IEglCorepublic boolean isCurrent(IEglSurfaceBase eglSfBase)
public int querySurface(IEglSurfaceBase eglSfBase, int what)
querySurface in interface IEglCorepublic IEglSurfaceBase createSurfaceBase()
createSurfaceBase in interface IEglCorepublic IWindowSurface createWindowSurface(android.view.Surface surface, boolean releaseSurface)
createWindowSurface in interface IEglCorepublic IWindowSurface createWindowSurface(android.view.SurfaceHolder holder, boolean releaseSurace)
createWindowSurface in interface IEglCorepublic IWindowSurface createWindowSurface(android.graphics.SurfaceTexture surfaceTexture)
createWindowSurface in interface IEglCoreprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprotected void releaseSurface(android.opengl.EGLSurface eglSurface)
protected android.opengl.EGLSurface createWindowSurface(java.lang.Object surface)
If this is destined for MediaCodec, the EGLConfig should have the "recordable" attribute.
protected android.opengl.EGLSurface createOffscreenSurface(int width,
int height)
protected void _makeCurrent(android.opengl.EGLSurface eglSurface)
protected void _makeCurrent(android.opengl.EGLSurface drawSurface,
android.opengl.EGLSurface readSurface)
public int _querySurface(android.opengl.EGLSurface eglSurface,
int what)
public boolean _isCurrent(android.opengl.EGLSurface eglSurface)
public void makeNothingCurrent()
makeNothingCurrent in interface IEglCorepublic boolean swapBuffers(android.opengl.EGLSurface eglSurface)
public void _setPresentationTime(android.opengl.EGLSurface eglSurface,
long nsecs)
public boolean isCurrent(android.opengl.EGLSurface eglSurface)
public int querySurface(android.opengl.EGLSurface eglSurface,
int what)
public java.lang.String queryString(int what)
public int getGlVersion()
getGlVersion in interface IEglCorepublic static void logCurrent(java.lang.String msg)
public android.opengl.EGLContext getEGLContext()
getEGLContext in interface IEglCore