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  */
7 
8 #include "SkSGEffectNode.h"
9 
10 namespace sksg {
11 
EffectNode(sk_sp<RenderNode> child)12 EffectNode::EffectNode(sk_sp<RenderNode> child)
13     : fChild(std::move(child)) {
14     this->observeInval(fChild);
15 }
16 
~EffectNode()17 EffectNode::~EffectNode() {
18     this->unobserveInval(fChild);
19 }
20 
onRender(SkCanvas * canvas) const21 void EffectNode::onRender(SkCanvas* canvas) const {
22     fChild->render(canvas);
23 }
24 
onRevalidate(InvalidationController * ic,const SkMatrix & ctm)25 SkRect EffectNode::onRevalidate(InvalidationController* ic, const SkMatrix& ctm) {
26     SkASSERT(this->hasInval());
27 
28     return fChild->revalidate(ic, ctm);
29 }
30 
31 } // namespace sksg
32