Enable inline/datauri image support for SkottieView

Change-Id: Ic22d65bcaf1ac8ef8d9a6dbd64281cdc6b0f0df8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/553540
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
This commit is contained in:
Florin Malita 2022-06-27 14:40:07 -04:00 committed by SkCQ
parent 9d10f64104
commit fe354d0963

View File

@ -13,6 +13,7 @@
#include "include/core/SkStream.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTime.h"
#include "modules/skresources/include/SkResources.h"
#include <jni.h>
#include <math.h>
#include <string>
@ -150,7 +151,9 @@ Java_org_skia_skottie_SkottieAnimation_nCreateProxy(JNIEnv *env,
skottieAnimation->mRunner = skottieRunner;
skottieAnimation->mStream = std::move(stream);
skottieAnimation->mAnimation = skottie::Animation::Make(skottieAnimation->mStream.get());
skottieAnimation->mAnimation = skottie::Animation::Builder()
.setResourceProvider(skresources::DataURIResourceProviderProxy::Make(nullptr))
.make(skottieAnimation->mStream.get());
skottieAnimation->mTimeBase = 0.0f; // force a time reset
skottieAnimation->mDuration = 1000 * skottieAnimation->mAnimation->duration();