dada960d79
This was the simplest one to start with. I need to add support for the "filter effect subregion" in order to handle tile stitching property, so this isn't quite complete. But I believe this is enough for the basic filters-turb-01-f test to pass, which gives us a baseline for further filter work. Summary of changes: - Added attribute type and parsing for SVG integer datatype - Added new node class for feTurbulence - Added several new properties and parsing for feTurbulence Bug: skia:10841 Change-Id: I8c877a5e1a837bfd527782253062eeb58febdde6 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330621 Commit-Queue: Tyler Denniston <tdenniston@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
38 lines
974 B
C++
38 lines
974 B
C++
/*
|
|
* Copyright 2020 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkSVGFe_DEFINED
|
|
#define SkSVGFe_DEFINED
|
|
|
|
#include "modules/svg/include/SkSVGHiddenContainer.h"
|
|
|
|
class SkImageFilter;
|
|
class SkSVGFilterContext;
|
|
|
|
class SkSVGFe : public SkSVGHiddenContainer {
|
|
public:
|
|
~SkSVGFe() override = default;
|
|
|
|
static bool IsFilterEffect(const sk_sp<SkSVGNode>& node) {
|
|
return node->tag() == SkSVGTag::kFeTurbulence;
|
|
}
|
|
|
|
sk_sp<SkImageFilter> makeImageFilter(const SkSVGRenderContext& ctx,
|
|
SkSVGFilterContext* fctx) const;
|
|
|
|
protected:
|
|
explicit SkSVGFe(SkSVGTag t) : INHERITED(t) {}
|
|
|
|
virtual sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
|
|
const SkSVGFilterContext&) const = 0;
|
|
|
|
private:
|
|
using INHERITED = SkSVGHiddenContainer;
|
|
};
|
|
|
|
#endif // SkSVGFe_DEFINED
|