Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Package Functions | Static Package Functions | Package Attributes | List of all members
org.skia.skottie.SkottieRunner Class Reference

Public Member Functions

SkottieAnimation createAnimation (TextureView view, InputStream is, int backgroundColor, int repeatCount)
 
SkottieAnimation createAnimation (SurfaceTexture surfaceTexture, InputStream is)
 
SkottieAnimation createAnimation (SurfaceView view, InputStream is, int backgroundColor, int repeatCount)
 
void updateAnimationSurface (Animatable animation, SurfaceTexture surfaceTexture, int width, int height)
 
void setMaxCacheSize (int maxCacheSize)
 

Static Public Member Functions

static synchronized SkottieRunner getInstance ()
 

Protected Member Functions

void finalize () throws Throwable
 

Package Functions

long getNativeProxy ()
 
void runOnGLThread (Runnable r) throws Throwable
 
EGLContext createContext (EGL10 egl, EGLDisplay eglDisplay, EGLConfig eglConfig)
 

Static Package Functions

 [static initializer]
 

Package Attributes

EGL10 mEgl
 
EGLDisplay mEglDisplay
 
EGLConfig mEglConfig
 
EGLContext mEglContext
 
EGLSurface mPBufferSurface
 

Detailed Description

Definition at line 30 of file SkottieRunner.java.

Member Function Documentation

◆ [static initializer]()

org.skia.skottie.SkottieRunner.[static initializer]
inlinestaticpackage

◆ createAnimation() [1/3]

SkottieAnimation org.skia.skottie.SkottieRunner.createAnimation ( SurfaceTexture  surfaceTexture,
InputStream  is 
)
inline

Create a new animation by feeding data from "is" and replaying in a SurfaceTexture. SurfaceTexture is possibly taken from a TextureView and can be updated with updateAnimationSurface.

Definition at line 74 of file SkottieRunner.java.

74 {
75 return new SkottieAnimation(surfaceTexture, is);
76 }

◆ createAnimation() [2/3]

SkottieAnimation org.skia.skottie.SkottieRunner.createAnimation ( SurfaceView  view,
InputStream  is,
int  backgroundColor,
int  repeatCount 
)
inline

Create a new animation by feeding data from "is" and replaying in a SurfaceView. State is controlled internally by SurfaceHolder.

Definition at line 82 of file SkottieRunner.java.

82 {
83 return new SkottieAnimation(view, is, backgroundColor, repeatCount);
84 }

◆ createAnimation() [3/3]

SkottieAnimation org.skia.skottie.SkottieRunner.createAnimation ( TextureView  view,
InputStream  is,
int  backgroundColor,
int  repeatCount 
)
inline

Create a new animation by feeding data from "is" and replaying in a TextureView. TextureView is tracked internally for SurfaceTexture state.

Definition at line 65 of file SkottieRunner.java.

65 {
66 return new SkottieAnimation(view, is, backgroundColor, repeatCount);
67 }

◆ createContext()

EGLContext org.skia.skottie.SkottieRunner.createContext ( EGL10  egl,
EGLDisplay  eglDisplay,
EGLConfig  eglConfig 
)
inlinepackage

Definition at line 223 of file SkottieRunner.java.

223 {
224 int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
225 return egl.eglCreateContext(eglDisplay, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
226 }

◆ finalize()

void org.skia.skottie.SkottieRunner.finalize ( ) throws Throwable
inlineprotected

Definition at line 113 of file SkottieRunner.java.

113 {
114 try {
115 runOnGLThread(this::doFinishGL);
116 } finally {
117 super.finalize();
118 }
119 }

◆ getInstance()

static synchronized SkottieRunner org.skia.skottie.SkottieRunner.getInstance ( )
inlinestatic

Gets SkottieRunner singleton instance.

Definition at line 54 of file SkottieRunner.java.

54 {
55 if (sInstance == null) {
56 sInstance = new SkottieRunner();
57 }
58 return sInstance;
59 }

◆ getNativeProxy()

long org.skia.skottie.SkottieRunner.getNativeProxy ( )
inlinepackage

Definition at line 121 of file SkottieRunner.java.

121{ return mNativeProxy; }

◆ runOnGLThread()

void org.skia.skottie.SkottieRunner.runOnGLThread ( Runnable  r) throws Throwable
inlinepackage

Definition at line 145 of file SkottieRunner.java.

145 {
146 runOnGLThread(r, false);
147 }

◆ setMaxCacheSize()

void org.skia.skottie.SkottieRunner.setMaxCacheSize ( int  maxCacheSize)
inline

Definition at line 275 of file SkottieRunner.java.

275 {
276 nSetMaxCacheSize(maxCacheSize, getNativeProxy());
277 }

◆ updateAnimationSurface()

void org.skia.skottie.SkottieRunner.updateAnimationSurface ( Animatable  animation,
SurfaceTexture  surfaceTexture,
int  width,
int  height 
)
inline

Pass a new SurfaceTexture: use this method only if managing TextureView outside SkottieRunner.

Definition at line 90 of file SkottieRunner.java.

91 {
92 try {
93 runOnGLThread(() -> {
94 ((SkottieAnimation) animation).setSurfaceTexture(surfaceTexture);
95 ((SkottieAnimation) animation).updateSurface(width, height);
96 });
97 }
98 catch (Throwable t) {
99 Log.e(LOG_TAG, "update failed", t);
100 throw new RuntimeException(t);
101 }
102 }
void Log(const char *format,...) SK_PRINTF_LIKE(1
int32_t height
int32_t width

Member Data Documentation

◆ mEgl

EGL10 org.skia.skottie.SkottieRunner.mEgl
package

Definition at line 41 of file SkottieRunner.java.

◆ mEglConfig

EGLConfig org.skia.skottie.SkottieRunner.mEglConfig
package

Definition at line 43 of file SkottieRunner.java.

◆ mEglContext

EGLContext org.skia.skottie.SkottieRunner.mEglContext
package

Definition at line 44 of file SkottieRunner.java.

◆ mEglDisplay

EGLDisplay org.skia.skottie.SkottieRunner.mEglDisplay
package

Definition at line 42 of file SkottieRunner.java.

◆ mPBufferSurface

EGLSurface org.skia.skottie.SkottieRunner.mPBufferSurface
package

Definition at line 45 of file SkottieRunner.java.


The documentation for this class was generated from the following file: