30class TintAdapter final :
public AnimatablePropertyContainer {
34 const AnimationBuilder& abuilder) {
38 const auto& node()
const {
return fFilterNode; }
43 const AnimationBuilder& abuilder)
46 , fFilterNode(
sksg::GradientColorFilter::
Make(
std::move(layer), fColorNode0, fColorNode1)) {
49 kMapBlackTo_Index = 0,
50 kMapWhiteTo_Index = 1,
54 kMax_Index = kAmount_Index,
57 EffectBinder(jprops, abuilder,
this)
58 .bind(kMapBlackTo_Index, fMapBlackTo)
59 .bind(kMapWhiteTo_Index, fMapWhiteTo)
60 .bind( kAmount_Index, fAmount );
63 void onSync()
override {
64 fColorNode0->setColor(fMapBlackTo);
65 fColorNode1->setColor(fMapWhiteTo);
67 fFilterNode->setWeight(fAmount / 100);
74 ColorValue fMapBlackTo,
constexpr SkColor SK_ColorBLACK
void attachDiscardableAdapter(sk_sp< T > adapter) const
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
SK_API sk_sp< SkShader > Color(SkColor)