/* * Copyright 2020 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkottieShapeLayer_DEFINED #define SkottieShapeLayer_DEFINED #include "include/private/SkNoncopyable.h" #include "modules/skottie/src/animator/Animator.h" #include "modules/sksg/include/SkSGMerge.h" #include namespace skjson { class ObjectValue; } // namespace skjson namespace sksg { class GeometryNode; class PaintNode; class RenderNode; } // namespace sksg namespace skottie { namespace internal { class AnimationBuilder; // TODO/TRANSITIONAL: not much state here yet, but will eventually hold ShapeLayer-related stuff. class ShapeBuilder final : SkNoncopyable { public: static sk_sp MergeGeometry(std::vector>&&, sksg::Merge::Mode); static sk_sp AttachPathGeometry(const skjson::ObjectValue&, const AnimationBuilder*); static sk_sp AttachRRectGeometry(const skjson::ObjectValue&, const AnimationBuilder*); static sk_sp AttachEllipseGeometry(const skjson::ObjectValue&, const AnimationBuilder*); static sk_sp AttachPolystarGeometry(const skjson::ObjectValue&, const AnimationBuilder*); static sk_sp AttachColorFill(const skjson::ObjectValue&, const AnimationBuilder*); static sk_sp AttachColorStroke(const skjson::ObjectValue&, const AnimationBuilder*); static sk_sp AttachGradientFill(const skjson::ObjectValue&, const AnimationBuilder*); static sk_sp AttachGradientStroke(const skjson::ObjectValue&, const AnimationBuilder*); static std::vector> AttachMergeGeometryEffect( const skjson::ObjectValue&, const AnimationBuilder*, std::vector>&&); static std::vector> AttachTrimGeometryEffect( const skjson::ObjectValue&, const AnimationBuilder*, std::vector>&&); static std::vector> AttachRoundGeometryEffect( const skjson::ObjectValue&, const AnimationBuilder*, std::vector>&&); static std::vector> AttachOffsetGeometryEffect( const skjson::ObjectValue&, const AnimationBuilder*, std::vector>&&); static std::vector> AttachPuckerBloatGeometryEffect( const skjson::ObjectValue&, const AnimationBuilder*, std::vector>&&); static std::vector> AdjustStrokeGeometry( const skjson::ObjectValue&, const AnimationBuilder*, std::vector>&&); static std::vector> AttachRepeaterDrawEffect( const skjson::ObjectValue&, const AnimationBuilder*, std::vector>&&); private: static sk_sp AttachFill(const skjson::ObjectValue&, const AnimationBuilder*, sk_sp, sk_sp = nullptr); static sk_sp AttachStroke(const skjson::ObjectValue&, const AnimationBuilder*, sk_sp, sk_sp = nullptr); }; } // namespace internal } // namespace skottie #endif // SkottieShapeLayer_DEFINED