401321d98e
- remove the custom-func SkSVGAttributeParser::parse version and always dispatch via SkSVGAttributeParser::parse<T>(T*) - this should avoid adding any other parse helper declarations in the future - relocate the turbulence parse helpers to SkSVGAttributeParser (while keeping the definition in SkSVGFETurbulence.cpp) - update ParseResult initialization to use move semantics Change-Id: I8ed9811671a6fbc5971f9d1f14e7b9c07da7dec0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332540 Commit-Queue: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@google.com> Reviewed-by: Tyler Denniston <tdenniston@google.com>
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
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 SkSVGFeTurbulence_DEFINED
|
|
#define SkSVGFeTurbulence_DEFINED
|
|
|
|
#include "modules/svg/include/SkSVGFe.h"
|
|
#include "modules/svg/include/SkSVGTypes.h"
|
|
|
|
class SkSVGFeTurbulence : public SkSVGFe {
|
|
public:
|
|
~SkSVGFeTurbulence() override = default;
|
|
static sk_sp<SkSVGFeTurbulence> Make() {
|
|
return sk_sp<SkSVGFeTurbulence>(new SkSVGFeTurbulence());
|
|
}
|
|
|
|
SVG_ATTR(BaseFrequency, SkSVGFeTurbulenceBaseFrequency, SkSVGFeTurbulenceBaseFrequency({}))
|
|
SVG_ATTR(NumOctaves, SkSVGIntegerType, SkSVGIntegerType(1))
|
|
SVG_ATTR(Seed, SkSVGNumberType, SkSVGNumberType(0))
|
|
SVG_ATTR(TurbulenceType,
|
|
SkSVGFeTurbulenceType,
|
|
SkSVGFeTurbulenceType(SkSVGFeTurbulenceType::Type::kTurbulence))
|
|
|
|
protected:
|
|
sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
|
|
const SkSVGFilterContext&) const override;
|
|
|
|
bool parseAndSetAttribute(const char*, const char*) override;
|
|
|
|
private:
|
|
SkSVGFeTurbulence() : INHERITED(SkSVGTag::kFeTurbulence) {}
|
|
|
|
using INHERITED = SkSVGFe;
|
|
};
|
|
|
|
#endif // SkSVGStop_DEFINED
|