OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SVGShapePainter_h | 5 #ifndef SVGShapePainter_h |
6 #define SVGShapePainter_h | 6 #define SVGShapePainter_h |
7 | 7 |
8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
10 | 10 |
11 class SkPaint; | 11 class SkPaint; |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class FloatRect; | 15 class FloatRect; |
16 struct MarkerPosition; | 16 struct MarkerPosition; |
17 struct PaintInfo; | 17 struct PaintInfo; |
18 class FloatPoint; | |
19 class GraphicsContext; | 18 class GraphicsContext; |
20 class LayoutSVGResourceMarker; | 19 class LayoutSVGResourceMarker; |
21 class LayoutSVGShape; | 20 class LayoutSVGShape; |
22 | 21 |
23 class SVGShapePainter { | 22 class SVGShapePainter { |
24 STACK_ALLOCATED(); | 23 STACK_ALLOCATED(); |
25 public: | 24 public: |
26 SVGShapePainter(LayoutSVGShape& layoutSVGShape) : m_layoutSVGShape(layoutSVG
Shape) { } | 25 SVGShapePainter(LayoutSVGShape& layoutSVGShape) : m_layoutSVGShape(layoutSVG
Shape) { } |
27 | 26 |
28 void paint(const PaintInfo&); | 27 void paint(const PaintInfo&); |
29 | 28 |
30 private: | 29 private: |
31 void fillShape(GraphicsContext*, const SkPaint&, SkPath::FillType); | 30 void fillShape(GraphicsContext*, const SkPaint&, SkPath::FillType); |
32 void strokeShape(GraphicsContext*, const SkPaint&); | 31 void strokeShape(GraphicsContext*, const SkPaint&); |
33 | 32 |
34 void paintMarkers(const PaintInfo&, const FloatRect& boundingBox); | 33 void paintMarkers(const PaintInfo&, const FloatRect& boundingBox); |
35 void paintMarker(const PaintInfo&, LayoutSVGResourceMarker&, const MarkerPos
ition&, float); | 34 void paintMarker(const PaintInfo&, LayoutSVGResourceMarker&, const MarkerPos
ition&, float); |
36 void strokeZeroLengthLineCaps(GraphicsContext*, const SkPaint&); | |
37 | 35 |
38 LayoutSVGShape& m_layoutSVGShape; | 36 LayoutSVGShape& m_layoutSVGShape; |
39 }; | 37 }; |
40 | 38 |
41 } // namespace blink | 39 } // namespace blink |
42 | 40 |
43 #endif // SVGShapePainter_h | 41 #endif // SVGShapePainter_h |
OLD | NEW |