abstract class EglSurface
Common base class for EGL surfaces. There can be multiple base surfaces associated with a single EglCore object.
EglSurface(eglCore: EglCore, eglSurface: EGLSurface)
Common base class for EGL surfaces. There can be multiple base surfaces associated with a single EglCore object. |
var eglCore: EglCore |
|
var eglSurface: EGLSurface |
fun getHeight(): Int
Returns the surface's height, in pixels. |
|
fun getWidth(): Int
Returns the surface's width, in pixels. |
|
fun isCurrent(): Boolean
Whether this surface is current on the attached EglCore. |
|
fun makeCurrent(): Unit
Makes our EGL context and surface current. fun makeCurrent(readSurface: EglSurface): Unit
Makes our EGL context and surface current for drawing, using the supplied surface for reading. |
|
fun makeNothingCurrent(): Unit
Makes no surface current for the attached eglCore. |
|
open fun release(): Unit
Release the EGL surface. |
|
fun setHeight(height: Int): Unit
Can be called by subclasses whose height is guaranteed to never change, so we can cache this value. For window surfaces, this should not be called. |
|
fun setPresentationTime(nsecs: Long): Unit
Sends the presentation time stamp to EGL. nsecs is the timestamp in nanoseconds. |
|
fun setWidth(width: Int): Unit
Can be called by subclasses whose width is guaranteed to never change, so we can cache this value. For window surfaces, this should not be called. |
|
fun toByteArray(format: CompressFormat = Bitmap.CompressFormat.PNG): ByteArray
Saves the EGL surface to given format. Expects that this object's EGL surface is current. |
|
fun toFile(file: File, format: CompressFormat = Bitmap.CompressFormat.PNG): Unit
Saves the EGL surface to a file. Expects that this object's EGL surface is current. |
|
fun toOutputStream(stream: OutputStream, format: CompressFormat = Bitmap.CompressFormat.PNG): Unit
Saves the EGL surface to the given output stream. Expects that this object's EGL surface is current. |
val TAG: String |
open class EglOffscreenSurface : EglSurface
A pbuffer EGL surface. |
|
open class EglWindowSurface : EglSurface
Recordable EGL window surface. It's good practice to explicitly release() the surface, preferably from a finally block. |