Tyler Denniston | dada960 | 2020-11-03 10:04:25 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef SkSVGFeTurbulence_DEFINED |
| 9 | #define SkSVGFeTurbulence_DEFINED |
| 10 | |
| 11 | #include "modules/svg/include/SkSVGFe.h" |
| 12 | #include "modules/svg/include/SkSVGTypes.h" |
| 13 | |
| 14 | class SkSVGFeTurbulence : public SkSVGFe { |
| 15 | public: |
Tyler Denniston | dada960 | 2020-11-03 10:04:25 -0500 | [diff] [blame] | 16 | static sk_sp<SkSVGFeTurbulence> Make() { |
| 17 | return sk_sp<SkSVGFeTurbulence>(new SkSVGFeTurbulence()); |
| 18 | } |
| 19 | |
| 20 | SVG_ATTR(BaseFrequency, SkSVGFeTurbulenceBaseFrequency, SkSVGFeTurbulenceBaseFrequency({})) |
| 21 | SVG_ATTR(NumOctaves, SkSVGIntegerType, SkSVGIntegerType(1)) |
| 22 | SVG_ATTR(Seed, SkSVGNumberType, SkSVGNumberType(0)) |
| 23 | SVG_ATTR(TurbulenceType, |
| 24 | SkSVGFeTurbulenceType, |
| 25 | SkSVGFeTurbulenceType(SkSVGFeTurbulenceType::Type::kTurbulence)) |
| 26 | |
| 27 | protected: |
Tyler Denniston | dada960 | 2020-11-03 10:04:25 -0500 | [diff] [blame] | 28 | sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&, |
| 29 | const SkSVGFilterContext&) const override; |
| 30 | |
Tyler Denniston | 62a683e | 2020-12-11 11:47:55 -0500 | [diff] [blame] | 31 | std::vector<SkSVGFeInputType> getInputs() const override { return {}; } |
Tyler Denniston | 5715499 | 2020-11-04 16:08:30 -0500 | [diff] [blame] | 32 | |
Tyler Denniston | 62a683e | 2020-12-11 11:47:55 -0500 | [diff] [blame] | 33 | bool parseAndSetAttribute(const char*, const char*) override; |
Tyler Denniston | dada960 | 2020-11-03 10:04:25 -0500 | [diff] [blame] | 34 | private: |
| 35 | SkSVGFeTurbulence() : INHERITED(SkSVGTag::kFeTurbulence) {} |
| 36 | |
Tyler Denniston | dada960 | 2020-11-03 10:04:25 -0500 | [diff] [blame] | 37 | using INHERITED = SkSVGFe; |
| 38 | }; |
| 39 | |
Tyler Denniston | b2d1a3b | 2020-12-11 10:31:07 -0500 | [diff] [blame] | 40 | #endif // SkSVGFeTurbulence_DEFINED |