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