Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
Android Documentation

Class WindowSurface





Recordable EGL window surface.

It's good practice to explicitly release() the surface, preferably from a "finally" block.


Inherited Fields

From Class Fields
com.android.grafika.gles.EglSurfaceBase mEglCore


WindowSurface( EglCore eglCore, Surface surface, boolean releaseSurface )

Associates an EGL surface with the native window surface.

Set releaseSurface to true if you want the Surface to be released when release() is called. This is convenient, but can interfere with framework classes that expect to manage the Surface themselves (e.g. if you release a SurfaceView's Surface, the surfaceDestroyed() callback won't fire).

public WindowSurface(EglCore eglCore,Surface surface,boolean releaseSurface)

Constructor Parameters


WindowSurface( EglCore eglCore, SurfaceTexture surfaceTexture )

Associates an EGL surface with the SurfaceTexture.

public WindowSurface(EglCore eglCore,SurfaceTexture surfaceTexture)

Constructor Parameters




Releases any resources associated with the EGL surface (and, if configured to do so, with the Surface as well).

Does not require that the surface's EGL context be current.

public void release()

recreate( EglCore newEglCore )

Recreate the EGLSurface, using the new EglBase. The caller should have already freed the old EGLSurface with releaseEglSurface().

This is useful when we want to update the EGLSurface associated with a Surface. For example, if we want to share with a different EGLContext, which can only be done by tearing down and recreating the context. (That's handled by the caller; this just creates a new EGLSurface for the Surface we were handed earlier.)

If the previous EGLSurface isn't fully destroyed, e.g. it's still current on a context somewhere, the create call will fail with complaints from the Surface about already being connected.

public void recreate(EglCore newEglCore)

Method Parameters


Inherited Methods

From Class Methods
com.android.grafika.gles.EglSurfaceBase createWindowSurface, createOffscreenSurface, getWidth, getHeight, releaseEglSurface, makeCurrent, makeCurrentReadFrom, swapBuffers, setPresentationTime, saveFrame
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section