blob: 24f97d4de4504a719e89b650bd87a1a66e7e6335 [file] [log] [blame]
Florin Malitab3418102020-10-15 18:10:29 -04001/*
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 SkSVGPath_DEFINED
9#define SkSVGPath_DEFINED
10
11#include "include/core/SkPath.h"
12#include "modules/svg/include/SkSVGShape.h"
13
14class SkSVGPath final : public SkSVGShape {
15public:
Florin Malitab3418102020-10-15 18:10:29 -040016 static sk_sp<SkSVGPath> Make() { return sk_sp<SkSVGPath>(new SkSVGPath()); }
17
Tyler Dennistonc505e432021-02-08 13:58:44 -050018 SVG_ATTR(Path, SkPath, SkPath())
Florin Malitab3418102020-10-15 18:10:29 -040019
20protected:
Tyler Dennistonc505e432021-02-08 13:58:44 -050021 bool parseAndSetAttribute(const char*, const char*) override;
Florin Malitab3418102020-10-15 18:10:29 -040022
23 void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
24 SkPathFillType) const override;
25
26 SkPath onAsPath(const SkSVGRenderContext&) const override;
27
Tyler Denniston3a92f772021-01-12 09:28:22 -050028 SkRect onObjectBoundingBox(const SkSVGRenderContext&) const override;
29
Florin Malitab3418102020-10-15 18:10:29 -040030private:
31 SkSVGPath();
32
Florin Malitab3418102020-10-15 18:10:29 -040033 using INHERITED = SkSVGShape;
34};
35
36#endif // SkSVGPath_DEFINED