Class SurfaceTextureWrapper
- java.lang.Object
-
- io.flutter.embedding.engine.renderer.SurfaceTextureWrapper
-
public class SurfaceTextureWrapper extends Object
A wrapper for a SurfaceTexture that tracks whether the texture has been released.The engine calls
SurfaceTexture.releaseon the platform thread, butupdateTexImageis called on the raster thread. This wrapper will preventupdateTexImagecalls on an abandoned texture.
-
-
Constructor Summary
Constructors Constructor Description SurfaceTextureWrapper(SurfaceTexture surfaceTexture)SurfaceTextureWrapper(SurfaceTexture surfaceTexture, Runnable onFrameConsumed)A wrapper for a SurfaceTexture.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattachToGLContext(int texName)voiddetachFromGLContext()voidgetTransformMatrix(float[] mtx)voidrelease()SurfaceTexturesurfaceTexture()voidupdateTexImage()
-
-
-
Constructor Detail
-
SurfaceTextureWrapper
public SurfaceTextureWrapper(@NonNull SurfaceTexture surfaceTexture)
-
SurfaceTextureWrapper
public SurfaceTextureWrapper(@NonNull SurfaceTexture surfaceTexture, @Nullable Runnable onFrameConsumed)A wrapper for a SurfaceTexture.The provided
onFrameConsumedcallback must be invoked when the most recent image was consumed.- Parameters:
onFrameConsumed- The callback after theupdateTexImageis called.
-
-
Method Detail
-
surfaceTexture
@NonNull public SurfaceTexture surfaceTexture()
-
updateTexImage
public void updateTexImage()
-
release
public void release()
-
attachToGLContext
public void attachToGLContext(int texName)
-
detachFromGLContext
public void detachFromGLContext()
-
getTransformMatrix
public void getTransformMatrix(@NonNull float[] mtx)
-
-