blob: 318194f28009319ef12f20394ffdc560b6b5899f [file] [log] [blame]
Tyler Denniston5878ece2021-01-15 09:17:55 -05001/*
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 SkSVGFeOffset_DEFINED
9#define SkSVGFeOffset_DEFINED
10
11#include "modules/svg/include/SkSVGFe.h"
12#include "modules/svg/include/SkSVGTypes.h"
13
14class SkSVGFeOffset : public SkSVGFe {
15public:
16 static sk_sp<SkSVGFeOffset> Make() { return sk_sp<SkSVGFeOffset>(new SkSVGFeOffset()); }
17
18 SVG_ATTR(Dx, SkSVGNumberType, SkSVGNumberType(0))
19 SVG_ATTR(Dy, SkSVGNumberType, SkSVGNumberType(0))
20
21protected:
22 sk_sp<SkImageFilter> onMakeImageFilter(const SkSVGRenderContext&,
23 const SkSVGFilterContext&) const override;
24
25 std::vector<SkSVGFeInputType> getInputs() const override { return {this->getIn()}; }
26
27 bool parseAndSetAttribute(const char*, const char*) override;
28
29private:
30 SkSVGFeOffset() : INHERITED(SkSVGTag::kFeOffset) {}
31
32 using INHERITED = SkSVGFe;
33};
34
35#endif // SkSVGFeOffset_DEFINED