2017-12-19 17:21:02 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2017 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkSGEffectNode_DEFINED
|
|
|
|
#define SkSGEffectNode_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "modules/sksg/include/SkSGRenderNode.h"
|
2017-12-19 17:21:02 +00:00
|
|
|
|
|
|
|
namespace sksg {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base class for nodes which apply some transformation when rendering
|
|
|
|
* their descendants.
|
|
|
|
*
|
|
|
|
* This includes transforms, clipping, filters, etc.
|
|
|
|
*/
|
|
|
|
class EffectNode : public RenderNode {
|
|
|
|
protected:
|
2019-02-10 17:54:20 +00:00
|
|
|
explicit EffectNode(sk_sp<RenderNode>, uint32_t inval_traits = 0);
|
2017-12-19 17:21:02 +00:00
|
|
|
~EffectNode() override;
|
|
|
|
|
2018-08-09 11:40:01 +00:00
|
|
|
void onRender(SkCanvas*, const RenderContext*) const override;
|
2019-02-12 14:33:21 +00:00
|
|
|
const RenderNode* onNodeAt(const SkPoint&) const override;
|
2017-12-19 17:21:02 +00:00
|
|
|
|
2018-01-05 16:32:31 +00:00
|
|
|
SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
|
2017-12-19 17:21:02 +00:00
|
|
|
|
2019-02-10 01:49:46 +00:00
|
|
|
const sk_sp<RenderNode>& getChild() const { return fChild; }
|
|
|
|
|
2017-12-19 17:21:02 +00:00
|
|
|
private:
|
|
|
|
sk_sp<RenderNode> fChild;
|
|
|
|
|
|
|
|
typedef RenderNode INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace sksg
|
|
|
|
|
|
|
|
#endif // SkSGEffectNode_DEFINED
|