-
- All Implemented Interfaces:
-
app.rive.core.CheckableAutoCloseable,java.lang.AutoCloseable
public final class RiveEGLSurface extends RiveSurface implements AutoCloseable
A collection of four surface properties needed for rendering.
An Android SurfaceTexture, provided by an Android SurfaceTextureListener
An EGLSurface, created from a Surface which is is in turn created from the SurfaceTexture
A Rive render target, created natively which renders to the GL framebuffer
A draw key, which uniquely identifies draw operations in the CommandQueue
Meant for use with and created from a RenderContextGL.
It also stores the width and height of the surface.
⚠️ This class assumes ownership of all resources and should be closed using CommandQueue.destroyRiveSurface when no longer needed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classRiveEGLSurface.Companion
-
Field Summary
Fields Modifier and Type Field Description private final LongsurfaceNativePointerprivate final Booleanclosedprivate final UniquePointerrenderTargetPointerprivate final DrawKeydrawKeyprivate final Integerwidthprivate final Integerheight
-
Constructor Summary
Constructors Constructor Description RiveEGLSurface(SurfaceTexture surfaceTexture, EGLSurface eglSurface, EGLDisplay display, Long renderTargetPointer, DrawKey drawKey, Integer width, Integer height)
-
Method Summary
Modifier and Type Method Description LonggetSurfaceNativePointer()BooleangetClosed()final UniquePointergetRenderTargetPointer()The native pointer to the Rive render target, held in a unique pointer. final DrawKeygetDrawKey()final IntegergetWidth()final IntegergetHeight()-
-
Constructor Detail
-
RiveEGLSurface
RiveEGLSurface(SurfaceTexture surfaceTexture, EGLSurface eglSurface, EGLDisplay display, Long renderTargetPointer, DrawKey drawKey, Integer width, Integer height)
- Parameters:
surfaceTexture- The Android SurfaceTexture to render against, likely created from a TextureView.eglSurface- The EGLSurface created from the Android Surface.display- The EGLDisplay used to create the EGLSurface, used for destroying it.renderTargetPointer- The native pointer to the Rive render target.drawKey- The key used to uniquely identify the draw operation in the CommandQueue.width- The width of the surface in pixels.height- The height of the surface in pixels.
-
-
Method Detail
-
getSurfaceNativePointer
Long getSurfaceNativePointer()
-
getRenderTargetPointer
final UniquePointer getRenderTargetPointer()
The native pointer to the Rive render target, held in a unique pointer.
-
getDrawKey
final DrawKey getDrawKey()
-
-
-
-