Home | History | Annotate | Download | only in src
      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 
     12 EffectNode::EffectNode(sk_sp<RenderNode> child)
     13     : fChild(std::move(child)) {
     14     this->observeInval(fChild);
     15 }
     16 
     17 EffectNode::~EffectNode() {
     18     this->unobserveInval(fChild);
     19 }
     20 
     21 void EffectNode::onRender(SkCanvas* canvas, const RenderContext* ctx) const {
     22     fChild->render(canvas, ctx);
     23 }
     24 
     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