[svg] Implement feComposite, basic filter result storage
- Plumbing to store filter results by id and resolve them as inputs
when referenced
- Added implementation of feComposite filter
- Added call to resolve input in feColorMatrix
- Bugfix to SkSVGFilterType operator==
The tests filters-color-01-b and filters-composite-03-b should now be
passing.
Bug: skia:10841
Change-Id: I2cd099c60ac21710f25184806c5cc537656b42af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332723
Commit-Queue: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
diff --git a/modules/svg/include/SkSVGFe.h b/modules/svg/include/SkSVGFe.h
index 7965a39..1031b15 100644
--- a/modules/svg/include/SkSVGFe.h
+++ b/modules/svg/include/SkSVGFe.h
@@ -18,11 +18,15 @@
~SkSVGFe() override = default;
static bool IsFilterEffect(const sk_sp<SkSVGNode>& node) {
- return node->tag() == SkSVGTag::kFeTurbulence || node->tag() == SkSVGTag::kFeColorMatrix;
+ return node->tag() == SkSVGTag::kFeTurbulence || node->tag() == SkSVGTag::kFeColorMatrix ||
+ node->tag() == SkSVGTag::kFeComposite;
}
sk_sp<SkImageFilter> makeImageFilter(const SkSVGRenderContext& ctx,
- SkSVGFilterContext* fctx) const;
+ const SkSVGFilterContext& fctx) const;
+
+ SVG_ATTR(In, SkSVGFeInputType, SkSVGFeInputType(SkSVGFeInputType::Type::kSourceGraphic))
+ SVG_ATTR(Result, SkSVGStringType, SkSVGStringType())
protected:
explicit SkSVGFe(SkSVGTag t) : INHERITED(t) {}
@@ -30,6 +34,8 @@
virtual sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
const SkSVGFilterContext&) const = 0;
+ bool parseAndSetAttribute(const char*, const char*) override;
+
private:
using INHERITED = SkSVGHiddenContainer;
};