skia2/modules/sksg/include/SkSGEffectNode.h
Florin Malita ef26fcb13f [sksg] Fix image filter content inval rect tracking
Image filters cannot let descendent damage pass through, as they may
transform their inputs arbitrarily.

Introduce the notion of "damage override" SG nodes (nodes which block
descendent damage and replace it with their own), and update
ImageFilterEffect to opt in for this behavior.

Also make InvalidationController damage dispatch optional (such that we
don't accumulate inval rects unnecessarily).

TBR=
Change-Id: Ie9f7d32ecdcc77dbe6ea009aed9ce269b3649a04
Reviewed-on: https://skia-review.googlesource.com/c/191005
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-10 21:43:20 +00:00

41 lines
905 B
C++

/*
* 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
#include "SkSGRenderNode.h"
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:
explicit EffectNode(sk_sp<RenderNode>, uint32_t inval_traits = 0);
~EffectNode() override;
void onRender(SkCanvas*, const RenderContext*) const override;
SkRect onRevalidate(InvalidationController*, const SkMatrix&) override;
const sk_sp<RenderNode>& getChild() const { return fChild; }
private:
sk_sp<RenderNode> fChild;
typedef RenderNode INHERITED;
};
} // namespace sksg
#endif // SkSGEffectNode_DEFINED