aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/sksg/src/SkSGEffectNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/sksg/src/SkSGEffectNode.cpp')
-rw-r--r--modules/sksg/src/SkSGEffectNode.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/modules/sksg/src/SkSGEffectNode.cpp b/modules/sksg/src/SkSGEffectNode.cpp
new file mode 100644
index 0000000000..70050ccb70
--- /dev/null
+++ b/modules/sksg/src/SkSGEffectNode.cpp
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkSGEffectNode.h"
+
+namespace sksg {
+
+EffectNode::EffectNode(sk_sp<RenderNode> child)
+ : fChild(std::move(child)) {
+ this->observeInval(fChild);
+}
+
+EffectNode::~EffectNode() {
+ this->unobserveInval(fChild);
+}
+
+void EffectNode::onRender(SkCanvas* canvas) const {
+ fChild->render(canvas);
+}
+
+SkRect EffectNode::onRevalidate(InvalidationController* ic, const SkMatrix& ctm) {
+ SkASSERT(this->hasInval());
+
+ return fChild->revalidate(ic, ctm);
+}
+
+} // namespace sksg