Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SkSGEffectNode.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2017 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
8
11
12#include <utility>
13
14class SkCanvas;
15class SkMatrix;
16struct SkPoint;
17
18namespace sksg {
19class InvalidationController;
20
21EffectNode::EffectNode(sk_sp<RenderNode> child, uint32_t inval_traits)
22 : INHERITED(inval_traits)
23 , fChild(std::move(child)) {
24 this->observeInval(fChild);
25}
26
28 this->unobserveInval(fChild);
29}
30
31void EffectNode::onRender(SkCanvas* canvas, const RenderContext* ctx) const {
32 fChild->render(canvas, ctx);
33}
34
35const RenderNode* EffectNode::onNodeAt(const SkPoint& p) const {
36 return fChild->nodeAt(p);
37}
38
40 SkASSERT(this->hasInval());
41
42 return fChild->revalidate(ic, ctm);
43}
44
45} // namespace sksg
#define SkASSERT(cond)
Definition SkAssert.h:116
EffectNode(sk_sp< RenderNode >, uint32_t inval_traits=0)
const RenderNode * onNodeAt(const SkPoint &) const override
void onRender(SkCanvas *, const RenderContext *) const override
SkRect onRevalidate(InvalidationController *, const SkMatrix &) override
void observeInval(const sk_sp< Node > &)
Definition SkSGNode.cpp:61
void unobserveInval(const sk_sp< Node > &)
Definition SkSGNode.cpp:84
bool hasInval() const
Definition SkSGNode.h:60
Definition Skottie.h:32
Definition ref_ptr.h:256