28static constexpr char kWebFontResource[] =
"fonts/Roboto-Regular.ttf";
29static constexpr char kSkottieResource[] =
"skottie/skottie_sample_webfont.json";
59 .setResourceProvider(sk_make_sp<FakeWebFontProvider>())
67 *errorMsg =
"No animation";
87 inline static constexpr SkScalar kSize = 800;
110 fPropManager = std::make_unique<skottie_utils::CustomPropertyManager>();
113 .setPropertyObserver(fPropManager->getPropertyObserver())
116 fColorProps = fPropManager->getColorProps();
117 fTextProps = fPropManager->getTextProps();
123 *errorMsg =
"No animation";
129 return DrawResult::kOk;
153 for (
const auto&
prop : fColorProps) {
154 fPropManager->setColor(
prop,
kColors[fColorIndex]);
156 for (
const auto&
prop : fTextProps) {
157 auto txtval = fPropManager->getText(
prop);
158 txtval.fFillColor =
kColors[fColorIndex];
159 fPropManager->setText(
prop, txtval);
171 const char* fResource;
174 std::unique_ptr<skottie_utils::CustomPropertyManager> fPropManager;
175 std::vector<skottie_utils::CustomPropertyManager::PropKey> fColorProps,
177 size_t fColorIndex = 0;
195 .setResourceProvider(sk_make_sp<MultiFrameResourceProvider>())
203 *errorMsg =
"No animation";
209 return DrawResult::kOk;
226 const char[])
const override {
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
sk_sp< SkData > GetResourceAsData(const char *resource)
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
static SkString resource(SkPDFResourceType type, int index)
#define INHERITED(method,...)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
skresources::ResourceProvider ResourceProvider
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
void onOnceBeforeDraw() override
SkISize getISize() override
SkString getName() const override
bool onAnimate(double nanos) override
SkottieColorizeGM(const char *name, const char *resource)
bool onChar(SkUnichar uni) override
SkString getName() const override
SkISize getISize() override
bool onAnimate(double nanos) override
void onOnceBeforeDraw() override
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
SkISize getISize() override
bool onAnimate(double nanos) override
void onOnceBeforeDraw() override
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
SkString getName() const override
void render(SkCanvas *canvas, const SkRect *dst=nullptr) const
void seek(SkScalar t, sksg::InvalidationController *ic=nullptr)
static sk_sp< MultiFrameImageAsset > Make(sk_sp< SkData >, ImageDecodeStrategy=ImageDecodeStrategy::kLazyDecode)
virtual sk_sp< ImageAsset > loadImageAsset(const char[], const char[], const char[]) const
virtual sk_sp< SkTypeface > loadTypeface(const char[], const char[]) const
SK_API std::unique_ptr< SkCodec > Decode(std::unique_ptr< SkStream >, SkCodec::Result *, SkCodecs::DecodeContext=nullptr)
sk_sp< Factory > BestAvailable()
DlVertices::Builder Builder
DEF_SWITCHES_START aot vmservice shared library name
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
static SkScalar prop(SkScalar radius, SkScalar newSize, SkScalar oldSize)
static constexpr SkISize Make(int32_t w, int32_t h)
static constexpr SkRect MakeWH(float w, float h)
std::shared_ptr< const fml::Mapping > data