26static constexpr char kWebFontResource[] =
"fonts/Roboto-Regular.ttf";
27static constexpr char kSkottieResource[] =
"skottie/skottie_sample_webfont.json";
55 fPropManager = std::make_unique<skottie_utils::CustomPropertyManager>();
58 .setResourceProvider(sk_make_sp<FakeWebFontProvider>())
59 .setPropertyObserver(fPropManager->getPropertyObserver())
67 *errorMsg =
"No animation";
71 for (
size_t i = 0;
i < 4; ++
i) {
72 this->update_props(
i);
91 void update_props(
size_t i) {
98 static constexpr struct {
99 const char* txt_string;
102 float transform_scale;
110 const auto& tst =
gTests[
i - 1];
112 for (
const auto&
prop : fPropManager->getColorProps()) {
116 for (
const auto&
prop : fPropManager->getTransformProps()) {
117 auto t = fPropManager->getTransform(
prop);
118 t.fScale = {tst.transform_scale, tst.transform_scale};
122 for (
const auto&
prop : fPropManager->getTextProps()) {
123 auto txt = fPropManager->getText(
prop);
124 txt.fText.
set(tst.txt_string);
125 txt.fFillColor = tst.txt_color;
130 inline static constexpr SkScalar kSize = 800;
133 std::unique_ptr<skottie_utils::CustomPropertyManager> fPropManager;
static const TestCase gTests[]
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
#define INHERITED(method,...)
skresources::ResourceProvider ResourceProvider
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
bool onAnimate(double nanos) override
SkString getName() const override
void onOnceBeforeDraw() override
SkISize getISize() override
void render(SkCanvas *canvas, const SkRect *dst=nullptr) const
void seek(SkScalar t, sksg::InvalidationController *ic=nullptr)
virtual sk_sp< SkTypeface > loadTypeface(const char[], const char[]) const
sk_sp< Factory > BestAvailable()
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
static SkScalar prop(SkScalar radius, SkScalar newSize, SkScalar oldSize)
static constexpr SkISize Make(int32_t w, int32_t h)
constexpr SkRect makeOffset(float dx, float dy) const
static constexpr SkRect MakeWH(float w, float h)