Skia
2D Graphics Library
SkSVGLine.h
Go to the documentation of this file.
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 SkSVGLine_DEFINED
9 #define SkSVGLine_DEFINED
10 
13 
14 struct SkPoint;
15 
16 class SK_API SkSVGLine final : public SkSVGShape {
17 public:
18  static sk_sp<SkSVGLine> Make() { return sk_sp<SkSVGLine>(new SkSVGLine()); }
19 
24 
25 protected:
26  bool parseAndSetAttribute(const char*, const char*) override;
27 
28  void onDraw(SkCanvas*, const SkSVGLengthContext&, const SkPaint&,
29  SkPathFillType) const override;
30 
31  SkPath onAsPath(const SkSVGRenderContext&) const override;
32 
33 private:
34  SkSVGLine();
35 
36  // resolve and return the two endpoints
37  std::tuple<SkPoint, SkPoint> resolve(const SkSVGLengthContext&) const;
38 
39  using INHERITED = SkSVGShape;
40 };
41 
42 #endif // SkSVGLine_DEFINED
SkPathFillType
Definition: SkPathTypes.h:11
#define SVG_ATTR(attr_name, attr_type, attr_default)
Definition: SkSVGNode.h:203
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
SkPaint controls options applied when drawing.
Definition: SkPaint.h:44
SkPath contain geometry.
Definition: SkPath.h:58
Definition: SkSVGRenderContext.h:27
Definition: SkSVGTypes.h:116
Definition: SkSVGLine.h:16
static sk_sp< SkSVGLine > Make()
Definition: SkSVGLine.h:18
Definition: SkSVGRenderContext.h:61
Definition: SkSVGShape.h:17
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:220