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 "modules/sksg/include/SkSGEffectNode.h"
9
10namespace sksg {
11
12EffectNode::EffectNode(sk_sp<RenderNode> child, uint32_t inval_traits)
13 : INHERITED(inval_traits)
14 , fChild(std::move(child)) {
15 this->observeInval(fChild);
16}
17
18EffectNode::~EffectNode() {
19 this->unobserveInval(fChild);
20}
21
22void EffectNode::onRender(SkCanvas* canvas, const RenderContext* ctx) const {
23 fChild->render(canvas, ctx);
24}
25
26const RenderNode* EffectNode::onNodeAt(const SkPoint& p) const {
27 return fChild->nodeAt(p);
28}
29
30SkRect EffectNode::onRevalidate(InvalidationController* ic, const SkMatrix& ctm) {
31 SkASSERT(this->hasInval());
32
33 return fChild->revalidate(ic, ctm);
34}
35
36} // namespace sksg
37