17 static constexpr char json[] =
39 "p": { "a": 0, "k": [0,25] }
53 {0xffff0000, 0xffff0000, 0xff00ff00, 0xffff0000, 0xff00ff00}},
55 {0xffff0000, 0xff00ff00, 0xff00ff00, 0xff00ff00, 0xff00ff00}},
57 {0xff00ff00, 0xffff0000, 0xff00ff00, 0xff00ff00, 0xff00ff00}},
59 {0xff00ff00, 0xff00ff00, 0xffff0000, 0xff00ff00, 0xff00ff00}},
61 {0xffff0000, 0xff00ff00, 0xff00ff00, 0xffff0000, 0xff00ff00}},
63 {0xffff0000, 0xffff0000, 0xff00ff00, 0xffff0000, 0xffff0000}},
66 class TestImageAsset final :
public ImageAsset {
72 surf->getCanvas()->drawColor(0xffff0000);
73 fImage = surf->makeImageSnapshot();
98 return sk_make_sp<TestImageAsset>(fTest, fReporter);
106 .setResourceProvider(sk_make_sp<TestResourceProvider>(
tests, r))
111 static constexpr SkSize render_size{100, 100};
117 surf->peekPixels(&pmap);
119 for (
const auto& tst :
tests) {
120 surf->getCanvas()->clear(0xff00ff00);
121 anim->seekFrameTime(tst.t);
122 anim->render(surf->getCanvas(), &
rect);
125 tst.c[0] == pmap.
getColor(render_size.width() / 2, render_size.height() / 2));
127 tst.c[1] == pmap.
getColor(1 , render_size.height() / 2));
129 tst.c[2] == pmap.
getColor(render_size.width() / 2, 1));
131 tst.c[3] == pmap.
getColor(render_size.width() - 1, render_size.height() / 2));
133 tst.c[4] == pmap.
getColor(render_size.width() /2 , render_size.height() - 1));
#define REPORTER_ASSERT(r, cond,...)
static SkMatrix Scale(SkScalar sx, SkScalar sy)
static SkMatrix Translate(SkScalar dx, SkScalar dy)
static const SkMatrix & I()
SkColor getColor(int x, int y) const
virtual FrameData getFrameData(float t)
virtual bool isMultiFrame()=0
virtual sk_sp< ImageAsset > loadImageAsset(const char[], const char[], const char[]) const
sk_sp< SkBlender > blender SkRect rect
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
DlVertices::Builder Builder
SkSamplingOptions(SkFilterMode::kLinear))
DEF_TEST(Skottie_Image_CustomTransform, r)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeSize(const SkSize &size)