public class EglSurfaceBase
extends java.lang.Object
There can be multiple surfaces associated with a single context.
| Modifier and Type | Field and Description |
|---|---|
protected EglCore |
mEglCore |
protected static java.lang.String |
TAG |
| Modifier | Constructor and Description |
|---|---|
protected |
EglSurfaceBase(EglCore eglCore) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkCurrentEgl()
Check Current display/surface/context is match
|
void |
createOffscreenSurface(int width,
int height)
Creates an off-screen surface.
|
void |
createWindowSurface(java.lang.Object surface)
Creates a window surface.
|
int |
getHeight()
Returns the surface's height, in pixels.
|
int |
getWidth()
Returns the surface's width, in pixels.
|
void |
makeCurrent()
Makes our EGL context and surface current.
|
void |
makeCurrentReadFrom(EglSurfaceBase readSurface)
Makes our EGL context and surface current for drawing, using the supplied surface
for reading.
|
void |
releaseEglSurface()
Release the EGL surface.
|
void |
saveFrame(java.io.File file)
Saves the EGL surface to a file.
|
void |
setPresentationTime(long nsecs)
Sends the presentation time stamp to EGL.
|
boolean |
swapBuffers()
Calls eglSwapBuffers.
|
protected static final java.lang.String TAG
protected EglCore mEglCore
protected EglSurfaceBase(EglCore eglCore)
public void createWindowSurface(java.lang.Object surface)
surface - May be a Surface or SurfaceTexture.public void createOffscreenSurface(int width,
int height)
public int getWidth()
If this is called on a window surface, and the underlying surface is in the process of changing size, we may not see the new size right away (e.g. in the "surfaceChanged" callback). The size should match after the next buffer swap.
public int getHeight()
public void releaseEglSurface()
public void makeCurrent()
public void makeCurrentReadFrom(EglSurfaceBase readSurface)
public boolean swapBuffers()
public void setPresentationTime(long nsecs)
nsecs - Timestamp, in nanoseconds.public boolean checkCurrentEgl()
public void saveFrame(java.io.File file)
throws java.io.IOException
Expects that this object's EGL surface is current.
java.io.IOException