bffc256687
Mostly plumb new length types, but also introduce a stateful parser, rect shape and named color support. R=reed@google.com,robertphillips@google.com,stephana@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2202053002 Review-Url: https://codereview.chromium.org/2202053002
35 lines
749 B
C++
35 lines
749 B
C++
/*
|
|
* 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"
|
|
#include "SkSVGShape.h"
|
|
|
|
class SkSVGPath final : public SkSVGShape {
|
|
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;
|
|
|
|
void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&) const override;
|
|
|
|
private:
|
|
SkSVGPath();
|
|
|
|
SkPath fPath;
|
|
|
|
typedef SkSVGShape INHERITED;
|
|
};
|
|
|
|
#endif // SkSVGPath_DEFINED
|