2016-07-27 01:46:34 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkSVGPath_DEFINED
|
|
|
|
#define SkSVGPath_DEFINED
|
|
|
|
|
|
|
|
#include "SkPath.h"
|
2016-08-03 17:21:11 +00:00
|
|
|
#include "SkSVGShape.h"
|
2016-07-27 01:46:34 +00:00
|
|
|
|
2016-08-03 17:21:11 +00:00
|
|
|
class SkSVGPath final : public SkSVGShape {
|
2016-07-27 01:46:34 +00:00
|
|
|
public:
|
|
|
|
virtual ~SkSVGPath() = default;
|
|
|
|
static sk_sp<SkSVGPath> Make() { return sk_sp<SkSVGPath>(new SkSVGPath()); }
|
|
|
|
|
|
|
|
void setPath(const SkPath& path) { fPath = path; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void onSetAttribute(SkSVGAttribute, const SkSVGValue&) override;
|
|
|
|
|
2016-08-03 17:21:11 +00:00
|
|
|
void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&) const override;
|
|
|
|
|
2016-07-27 01:46:34 +00:00
|
|
|
private:
|
|
|
|
SkSVGPath();
|
|
|
|
|
|
|
|
SkPath fPath;
|
|
|
|
|
2016-08-03 17:21:11 +00:00
|
|
|
typedef SkSVGShape INHERITED;
|
2016-07-27 01:46:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SkSVGPath_DEFINED
|