17static jlong Animation_Create(JNIEnv*
env, jobject, jstring jjson) {
23 return reinterpret_cast<jlong
>(animation.release());
26static void Animation_Release(JNIEnv, jobject, jlong native_animation) {
30static jdouble Animation_GetDuration(JNIEnv, jobject, jlong native_animation) {
31 const auto* animation =
reinterpret_cast<const Animation*
>(native_animation);
32 return animation ? animation->
duration() : 0;
35static jdouble Animation_GetFrameCnt(JNIEnv, jobject, jlong native_animation) {
36 const auto* animation =
reinterpret_cast<const Animation*
>(native_animation);
37 return animation ? animation->
outPoint() : 0;
40static jfloat Animation_GetWidth(JNIEnv, jobject, jlong native_animation) {
41 const auto* animation =
reinterpret_cast<const Animation*
>(native_animation);
42 return animation ? animation->
size().
width() : 0;
45static jfloat Animation_GetHeight(JNIEnv, jobject, jlong native_animation) {
46 const auto* animation =
reinterpret_cast<const Animation*
>(native_animation);
47 return animation ? animation->
size().
height() : 0;
50static void Animation_SeekFrame(JNIEnv, jobject, jlong native_animation, jdouble
frame) {
51 if (
auto* animation =
reinterpret_cast<Animation*
>(native_animation)) {
52 animation->seekFrame(
frame);
56static void Animation_SeekTime(JNIEnv, jobject, jlong native_animation, jdouble t) {
57 if (
auto* animation =
reinterpret_cast<Animation*
>(native_animation)) {
58 animation->seekFrameTime(t);
62static void Animation_Render(JNIEnv, jobject, jlong native_animation, jlong native_canvas) {
63 const auto* animation =
reinterpret_cast<const Animation*
>(native_animation);
64 auto* canvas =
reinterpret_cast<SkCanvas*
>(native_canvas);
65 if (animation && canvas) {
66 animation->render(canvas);
73 static const JNINativeMethod methods[] = {
74 {
"nCreate" ,
"(Ljava/lang/String;)J",
reinterpret_cast<void*
>(Animation_Create) },
75 {
"nRelease" ,
"(J)V" ,
reinterpret_cast<void*
>(Animation_Release) },
77 {
"nGetDuration" ,
"(J)D" ,
reinterpret_cast<void*
>(Animation_GetDuration)},
78 {
"nGetFrameCount",
"(J)D" ,
reinterpret_cast<void*
>(Animation_GetFrameCnt)},
79 {
"nGetWidth" ,
"(J)F" ,
reinterpret_cast<void*
>(Animation_GetWidth) },
80 {
"nGetHeight" ,
"(J)F" ,
reinterpret_cast<void*
>(Animation_GetHeight) },
82 {
"nSeekFrame" ,
"(JD)V" ,
reinterpret_cast<void*
>(Animation_SeekFrame) },
83 {
"nSeekTime" ,
"(JD)V" ,
reinterpret_cast<void*
>(Animation_SeekTime) },
84 {
"nRender" ,
"(JJ)V" ,
reinterpret_cast<void*
>(Animation_Render) },
87 const auto clazz =
env->FindClass(
"org/skia/jetski/SkottieAnimation");
89 ?
env->RegisterNatives(clazz, methods,
std::size(methods))
static void SkSafeUnref(T *obj)
int register_jetski_SkottieAnimation(JNIEnv *env)
const SkSize & size() const
DlVertices::Builder Builder
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size