21 static constexpr char json[] =
22 "{\"v\":\" \",\"fr\":3,\"w\":4,\"h\":3,\"layers\":[{\"ty\": 1, \"sw\": 10, \"sh\": 10,"
23 " \"sc\":\"#ffffff\", \"ks\":{\"o\":{\"a\": true, \"k\":"
24 " [{\"t\": 0, \"s\": 0, \"e\": 1, \"i\": {\"x\":[]}}]}}}]}";
33 static constexpr char json[] = R
"({
47 "o": { "a": 0, "k": 50 }
70 void onMarker(
const char name[],
float t0,
float t1)
override {
71 fMarkers.push_back(std::make_tuple(
name, t0, t1));
74 std::vector<std::tuple<std::string, float, float>> fMarkers;
78 auto observer = sk_make_sp<TestMarkerObserver>();
81 .setMarkerObserver(observer)
103 : fSingleFrameAsset(std::move(single_asset))
104 , fMultiFrameAsset (std::move( multi_asset)) {}
109 const char id[])
const override {
110 return strcmp(
id,
"single_frame")
121 bool deferred_image_loading) {
122 static constexpr char json[] = R
"({
131 "id": "single_frame",
132 "p" : "single_frame.png",
139 "p" : "multi_frame.png",
148 "refId": "single_frame",
156 "refId": "multi_frame",
167 const auto flags = deferred_image_loading
172 .setResourceProvider(sk_make_sp<TestResourceProvider>(std::move(single_asset),
173 std::move( multi_asset)))
183 explicit TestAsset(
bool multi_frame) : fMultiFrame(multi_frame) {}
185 const std::vector<float>& requestedFrames()
const {
return fRequestedFrames; }
191 fRequestedFrames.push_back(t);
196 const bool fMultiFrame;
198 std::vector<float> fRequestedFrames;
202 auto single_asset = sk_make_sp<TestAsset>(
false),
203 multi_asset = sk_make_sp<TestAsset>(
true);
207 auto animation = make_animation(single_asset, multi_asset,
false);
213 animation->seekFrameTime(1);
218 animation->seekFrameTime(2);
225 auto single_asset = sk_make_sp<TestAsset>(
false),
226 multi_asset = sk_make_sp<TestAsset>(
true);
229 auto animation = make_animation(single_asset, multi_asset,
true);
234 animation->seekFrameTime(1);
240 animation->seekFrameTime(2);
248 static constexpr char json[] =
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
DEF_TEST(Skottie_OssFuzz8956, reporter)
#define REPORTER_ASSERT(r, cond,...)
sk_sp< SkImage > makeImageSnapshot()
virtual void onMarker(const char name[], float t0, float t1)=0
virtual sk_sp< SkImage > getFrame(float t)
virtual bool isMultiFrame()=0
virtual sk_sp< ImageAsset > loadImageAsset(const char[], const char[], const char[]) const
FlutterSemanticsFlag flags
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
DlVertices::Builder Builder
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library name
const myers::Point & get< 1 >(const myers::Segment &s)
const myers::Point & get< 0 >(const myers::Segment &s)
static SkImageInfo MakeN32Premul(int width, int height)