Debian Codegraph @

modules/svg/include/SkSVGEllipse.h

raw
1 /*
2 * Copyright 2016 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 SkSVGEllipse_DEFINED
9 #define SkSVGEllipse_DEFINED
10
11 #include "include/core/SkPath.h"
12 #include "include/core/SkPathTypes.h"
13 #include "include/core/SkRefCnt.h"
14 #include "include/private/base/SkAPI.h"
15 #include "modules/svg/include/SkSVGNode.h"
16 #include "modules/svg/include/SkSVGShape.h"
17 #include "modules/svg/include/SkSVGTypes.h"
18
19 class SkCanvas;
20 class SkPaint;
21 class SkSVGLengthContext;
22 class SkSVGRenderContext;
23 struct SkRect;
24
25 class SK_API SkSVGEllipse final : public SkSVGShape {
26 public:
27 static sk_sp<SkSVGEllipse> Make() { return sk_sp<SkSVGEllipse>(new SkSVGEllipse()); }
28
29 SVG_ATTR(Cx, SkSVGLength, SkSVGLength(0))
30 SVG_ATTR(Cy, SkSVGLength, SkSVGLength(0))
31
32 SVG_OPTIONAL_ATTR(Rx, SkSVGLength)
33 SVG_OPTIONAL_ATTR(Ry, SkSVGLength)
34
35 protected:
36 bool parseAndSetAttribute(const char*, const char*) override;
37
38 void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
39 SkPathFillType) const override;
40
41 SkPath onAsPath(const SkSVGRenderContext&) const override;
42
43 private:
44 SkSVGEllipse();
45
46 SkRect resolve(const SkSVGLengthContext&) const;
47
48 using INHERITED = SkSVGShape;
49 };
50
51 #endif // SkSVGEllipse_DEFINED