blob: 48b2ead0c1d436573d0308167ad177ffa4491543 [file] [log] [blame]
fmalitabffc2562016-08-03 10:21:11 -07001/*
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 SkSVGShape_DEFINED
9#define SkSVGShape_DEFINED
10
Florin Malitae932d4b2016-12-01 13:35:11 -050011#include "SkPath.h"
fmalitabffc2562016-08-03 10:21:11 -070012#include "SkSVGTransformableNode.h"
13
14class SkSVGLengthContext;
15class SkPaint;
16
17class SkSVGShape : public SkSVGTransformableNode {
18public:
19 virtual ~SkSVGShape() = default;
20
21 void appendChild(sk_sp<SkSVGNode>) override;
22
23protected:
24 SkSVGShape(SkSVGTag);
25
fmalita397a5172016-08-08 11:38:55 -070026 void onRender(const SkSVGRenderContext&) const final;
fmalitabffc2562016-08-03 10:21:11 -070027
Florin Malitae932d4b2016-12-01 13:35:11 -050028 virtual void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
29 SkPath::FillType) const = 0;
30
31 static SkPath::FillType FillRuleToFillType(const SkSVGFillRule&);
fmalitabffc2562016-08-03 10:21:11 -070032
33private:
34 typedef SkSVGTransformableNode INHERITED;
35};
36
37#endif // SkSVGShape_DEFINED