37class InvalidationController;
57 const RenderNode* onNodeAt(
const SkPoint&)
const override {
return nullptr; }
61 const auto content_bounds = this->children()[0]->revalidate(ic, ctm);
63 if (fCompletion >= 100) {
67 if (fCompletion <= 0) {
69 fMaskShader =
nullptr;
73 const auto t = fCompletion * 0.01f;
79 auto sanitize_angle = [](
float a) {
80 a = std::fmod(
a, 360);
87 auto a0 = sanitize_angle(fStartAngle - 90 + t * this->wipeAlignment()),
88 a1 = sanitize_angle(a0 + t * 360);
94 const SkColor grad_colors[] = { c1, c0, c0, c1 };
95 const SkScalar grad_pos[] = { 0, 0, 1, 1 };
98 grad_colors, grad_pos,
104 if (fMaskSigma > 0) {
109 return content_bounds;
112 void onRender(
SkCanvas* canvas,
const RenderContext* ctx)
const override {
113 if (fCompletion >= 100) {
118 const auto local_ctx = ScopedRenderContext(canvas, ctx)
120 this->children()[0]->render(canvas, local_ctx);
124 float wipeAlignment()
const {
127 case 2:
return -360.0f;
128 case 3:
return -180.0f;
134 SkPoint fWipeCenter = { 0, 0 };
135 float fCompletion = 0,
147class RadialWipeAdapter final :
public DiscardableAdapterBase<RadialWipeAdapter, RWipeRenderNode> {
151 const AnimationBuilder& abuilder)
155 kCompletion_Index = 0,
156 kStartAngle_Index = 1,
157 kWipeCenter_Index = 2,
162 EffectBinder(jprops, abuilder,
this)
163 .bind(kCompletion_Index, fCompletion)
164 .bind(kStartAngle_Index, fStartAngle)
165 .bind(kWipeCenter_Index, fWipeCenter)
166 .bind( kWipe_Index, fWipe )
167 .bind( kFeather_Index, fFeather );
171 void onSync()
override {
172 const auto& wiper = this->node();
174 wiper->setCompletion(fCompletion);
175 wiper->setStartAngle(fStartAngle);
176 wiper->setWipeCenter({fWipeCenter.
x, fWipeCenter.
y});
177 wiper->setWipe(fWipe);
178 wiper->setFeather(fFeather);
187 using INHERITED = DiscardableAdapterBase<RadialWipeAdapter, RWipeRenderNode>;
#define INHERITED(method,...)
sk_sp< T > sk_make_sp(Args &&... args)
void swap(sk_sp< T > &a, sk_sp< T > &b)
#define SG_ATTRIBUTE(attr_name, attr_type, attr_container)
#define SkScalarRoundToInt(x)
SkMatrix getTotalMatrix() const
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
void attachDiscardableAdapter(sk_sp< T > adapter) const
static float max(float r, float g, float b)
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
static constexpr float kBlurSizeToSigma
constexpr float y() const
constexpr float x() const
static constexpr SkRect MakeEmpty()