30 const auto key = fMgr->acceptKey(node_name,
".Color");
32 fMgr->fColorMap[
key].push_back(c());
38 const auto key = fMgr->acceptKey(node_name,
".Opacity");
40 fMgr->fOpacityMap[
key].push_back(o());
46 const auto key = fMgr->acceptKey(node_name,
".Transform");
48 fMgr->fTransformMap[
key].push_back(t());
54 const auto key = fMgr->acceptKey(node_name,
".Text");
56 fMgr->fTextMap[
key].push_back(t());
60 void onEnterNode(
const char node_name[], PropertyObserver::NodeType node_type)
override {
61 if (node_name ==
nullptr) {
65 fMgr->fCurrentNode.empty() ? node_name : fMgr->fCurrentNode +
"." + node_name;
68 void onLeavingNode(
const char node_name[], PropertyObserver::NodeType node_type)
override {
69 if (node_name ==
nullptr) {
72 auto length = strlen(node_name);
74 fMgr->fCurrentNode.length() >
length
75 ? fMgr->fCurrentNode.substr(
76 0, fMgr->fCurrentNode.length() - strlen(node_name) - 1)
90 fMgr->fMarkers.push_back({ std::string(
name), t0, t1 });
105std::string CustomPropertyManager::acceptKey(
const char*
name,
const char*
suffix)
const {
107 return std::string();
116 return fPropertyInterceptor;
120 return fMarkerInterceptor;
124std::vector<CustomPropertyManager::PropKey>
125CustomPropertyManager::getProps(
const PropMap<T>& container)
const {
126 std::vector<PropKey> props;
128 for (
const auto& prop_list : container) {
129 SkASSERT(!prop_list.second.empty());
130 props.push_back(prop_list.first);
136template <
typename V,
typename T>
137V CustomPropertyManager::get(
const PropKey&
key,
const PropMap<T>& container)
const {
138 auto prop_group = container.find(
key);
140 return prop_group == container.end()
142 : prop_group->second.front()->get();
146std::unique_ptr<T> CustomPropertyManager::getHandle(
const PropKey&
key,
148 const PropMap<T>& container)
const {
149 auto prop_group = container.find(
key);
151 if (prop_group == container.end() || index >= prop_group->second.size()) {
155 return std::make_unique<T>(*prop_group->second[index]);
158template <
typename V,
typename T>
159bool CustomPropertyManager::set(
const PropKey&
key,
const V& val,
const PropMap<T>& container) {
160 auto prop_group = container.find(
key);
162 if (prop_group == container.end()) {
166 for (
auto& handle : prop_group->second) {
173std::vector<CustomPropertyManager::PropKey>
175 return this->getProps(fColorMap);
179 return this->get<skottie::ColorPropertyValue>(
key, fColorMap);
182std::unique_ptr<skottie::ColorPropertyHandle>
184 return this->getHandle(
key, index, fColorMap);
188 return this->set(
key, c, fColorMap);
191std::vector<CustomPropertyManager::PropKey>
193 return this->getProps(fOpacityMap);
197 return this->get<skottie::OpacityPropertyValue>(
key, fOpacityMap);
200std::unique_ptr<skottie::OpacityPropertyHandle>
202 return this->getHandle(
key, index, fOpacityMap);
206 return this->set(
key, o, fOpacityMap);
209std::vector<CustomPropertyManager::PropKey>
211 return this->getProps(fTransformMap);
215 return this->get<skottie::TransformPropertyValue>(
key, fTransformMap);
218std::unique_ptr<skottie::TransformPropertyHandle>
220 return this->getHandle(
key, index, fTransformMap);
225 return this->set(
key, t, fTransformMap);
228std::vector<CustomPropertyManager::PropKey>
230 return this->getProps(fTextMap);
234 return this->get<skottie::TextPropertyValue>(
key, fTextMap);
237std::unique_ptr<skottie::TextPropertyHandle>
239 return this->getHandle(
key, index, fTextMap);
243 return this->set(
key, o, fTextMap);
251 : fAnimation(
std::move(anim))
260 const auto flags = skottie::Animation::RenderFlag::kSkipTopLevelIsolation;
273 const char prefixp[])
274 : fResourceProvider(
std::move(rprovider))
275 , fPrefix(prefixp) {}
292 .setResourceProvider(fResourceProvider)
293 .make(
static_cast<const char*
>(
data->data()),
data->size());
295 return anim ? sk_make_sp<ExternalAnimationLayer>(std::move(anim),
size)
sk_sp< T > sk_make_sp(Args &&... args)
sk_sp< T > sk_ref_sp(T *obj)
static bool SkStrStartsWith(const char string[], const char prefixStr[])
const char * c_str() const
void seekFrameTime(double t, sksg::InvalidationController *=nullptr)
void render(SkCanvas *canvas, const SkRect *dst=nullptr) const
std::function< std::unique_ptr< T >()> LazyHandle
MarkerInterceptor(CustomPropertyManager *mgr)
void onMarker(const char name[], float t0, float t1) override
void onTextProperty(const char node_name[], const LazyHandle< skottie::TextPropertyHandle > &t) override
void onTransformProperty(const char node_name[], const LazyHandle< skottie::TransformPropertyHandle > &t) override
void onOpacityProperty(const char node_name[], const LazyHandle< skottie::OpacityPropertyHandle > &o) override
void onLeavingNode(const char node_name[], PropertyObserver::NodeType node_type) override
void onColorProperty(const char node_name[], const LazyHandle< skottie::ColorPropertyHandle > &c) override
void onEnterNode(const char node_name[], PropertyObserver::NodeType node_type) override
PropertyInterceptor(CustomPropertyManager *mgr)
sk_sp< skottie::MarkerObserver > getMarkerObserver() const
bool setOpacity(const PropKey &, const skottie::OpacityPropertyValue &)
skottie::ColorPropertyValue getColor(const PropKey &) const
bool setTransform(const PropKey &, const skottie::TransformPropertyValue &)
std::unique_ptr< skottie::OpacityPropertyHandle > getOpacityHandle(const PropKey &, size_t) const
bool setColor(const PropKey &, const skottie::ColorPropertyValue &)
bool setText(const PropKey &, const skottie::TextPropertyValue &)
std::vector< PropKey > getColorProps() const
std::unique_ptr< skottie::TextPropertyHandle > getTextHandle(const PropKey &, size_t index) const
skottie::TransformPropertyValue getTransform(const PropKey &) const
std::unique_ptr< skottie::TransformPropertyHandle > getTransformHandle(const PropKey &, size_t) const
std::unique_ptr< skottie::ColorPropertyHandle > getColorHandle(const PropKey &, size_t) const
std::vector< PropKey > getTextProps() const
skottie::TextPropertyValue getText(const PropKey &) const
std::vector< PropKey > getOpacityProps() const
sk_sp< skottie::PropertyObserver > getPropertyObserver() const
std::vector< PropKey > getTransformProps() const
CustomPropertyManager(Mode=Mode::kNamespacedProperties, const char *prefix=nullptr)
skottie::OpacityPropertyValue getOpacity(const PropKey &) const
~ExternalAnimationPrecompInterceptor() override
ExternalAnimationPrecompInterceptor(sk_sp< skresources::ResourceProvider >, const char prefix[])
virtual sk_sp< SkData > load(const char[], const char[]) const
FlutterSemanticsFlag flags
T __attribute__((ext_vector_type(N))) V
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 mode
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
def render(idl_node, indent_str=' ')
float OpacityPropertyValue
SkColor ColorPropertyValue
static constexpr SkRect MakeSize(const SkSize &size)
std::shared_ptr< const fml::Mapping > data