Flutter Engine
The Flutter Engine
Path.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
14#include "src/utils/SkJSON.h"
15
16#include <utility>
17
18namespace skottie {
19namespace internal {
20
21namespace {
22
23class PathAdapter final : public DiscardableAdapterBase<PathAdapter, sksg::Path> {
24public:
25 PathAdapter(const skjson::Value& jpath, const AnimationBuilder& abuilder)
26 : INHERITED(sksg::Path::Make()) {
27 this->bind(abuilder, jpath, fShape);
28 }
29
30private:
31 void onSync() override {
32 const auto& path_node = this->node();
33
35
36 // FillType is tracked in the SG node, not in keyframes -- make sure we preserve it.
37 path.setFillType(path_node->getFillType());
38 path.setIsVolatile(!this->isStatic());
39
40 path_node->setPath(path);
41 }
42
43 ShapeValue fShape;
44
45 using INHERITED = DiscardableAdapterBase<PathAdapter, sksg::Path>;
46};
47
48} // namespace
49
51 return this->attachDiscardableAdapter<PathAdapter>(jpath, *this);
52}
53
54} // namespace internal
55} // namespace skottie
#define INHERITED(method,...)
Definition: SkRecorder.cpp:128
GrStyledShape fShape
Definition: SkPath.h:59
sk_sp< sksg::Path > attachPath(const skjson::Value &) const
Definition: Path.cpp:50
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
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
Definition: switches.h:57
CanvasPath Path
Definition: dart_ui.cc:58
Definition: Skottie.h:32