34class TransformEffectAdapter final :
public DiscardableAdapterBase<TransformEffectAdapter,
35 sksg::OpacityEffect> {
37 TransformEffectAdapter(
const AnimationBuilder& abuilder,
45 , fTransformAdapter(
std::move(tadapter)) {
46 this->bind(abuilder, jopacity , fOpacity );
47 this->bind(abuilder, jscale_uniform, fUniformScale);
48 this->bind(abuilder, jscale_width , fScaleWidth );
49 this->bind(abuilder, jscale_height , fScaleHeight );
51 this->attachDiscardableAdapter(fTransformAdapter);
55 void onSync()
override {
56 this->node()->setOpacity(fOpacity * 0.01f);
64 fTransformAdapter->setScale(
scale);
74 using INHERITED = DiscardableAdapterBase<TransformEffectAdapter, sksg::OpacityEffect>;
82 kAnchorPoint_Index = 0,
84 kUniformScale_Index = 2,
85 kScaleHeight_Index = 3,
86 kScaleWidth_Index = 4,
103 if (!transform_adapter) {
108 transform_adapter->node());
115 std::move(transform_adapter),
116 std::move(transform_effect_node)
#define INHERITED(method,...)
#define SkScalarRoundToInt(x)
void attachDiscardableAdapter(sk_sp< T > adapter) const
static sk_sp< TransformAdapter2D > Make(Args &&... args)
static const skjson::Value & GetPropValue(const skjson::ArrayValue &jprops, size_t prop_index)
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
static constexpr SkPoint Make(float x, float y)