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 #ifndef SkSGEffectNode_DEFINED 9 #define SkSGEffectNode_DEFINED 10 11 #include "SkSGRenderNode.h" 12 13 namespace sksg { 14 15 /** 16 * Base class for nodes which apply some transformation when rendering 17 * their descendants. 18 * 19 * This includes transforms, clipping, filters, etc. 20 */ 21 class EffectNode : public RenderNode { 22 protected: 23 explicit EffectNode(sk_sp<RenderNode>); 24 ~EffectNode() override; 25 26 void onRender(SkCanvas*, const RenderContext*) const override; 27 28 SkRect onRevalidate(InvalidationController*, const SkMatrix&) override; 29 30 private: 31 sk_sp<RenderNode> fChild; 32 33 typedef RenderNode INHERITED; 34 }; 35 36 } // namespace sksg 37 38 #endif // SkSGEffectNode_DEFINED 39