OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 LineLayoutSVGTextPath_h | 5 #ifndef LineLayoutSVGTextPath_h |
6 #define LineLayoutSVGTextPath_h | 6 #define LineLayoutSVGTextPath_h |
7 | 7 |
8 #include "core/layout/api/LineLayoutSVGInline.h" | 8 #include "core/layout/api/LineLayoutSVGInline.h" |
9 #include "core/layout/svg/LayoutSVGTextPath.h" | 9 #include "core/layout/svg/LayoutSVGTextPath.h" |
| 10 #include <memory> |
10 | 11 |
11 namespace blink { | 12 namespace blink { |
12 | 13 |
13 class LineLayoutSVGTextPath : public LineLayoutSVGInline { | 14 class LineLayoutSVGTextPath : public LineLayoutSVGInline { |
14 public: | 15 public: |
15 explicit LineLayoutSVGTextPath(LayoutSVGTextPath* layoutSVGTextPath) | 16 explicit LineLayoutSVGTextPath(LayoutSVGTextPath* layoutSVGTextPath) |
16 : LineLayoutSVGInline(layoutSVGTextPath) | 17 : LineLayoutSVGInline(layoutSVGTextPath) |
17 { | 18 { |
18 } | 19 } |
19 | 20 |
20 explicit LineLayoutSVGTextPath(const LineLayoutItem& item) | 21 explicit LineLayoutSVGTextPath(const LineLayoutItem& item) |
21 : LineLayoutSVGInline(item) | 22 : LineLayoutSVGInline(item) |
22 { | 23 { |
23 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isSVGTextPath()); | 24 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isSVGTextPath()); |
24 } | 25 } |
25 | 26 |
26 explicit LineLayoutSVGTextPath(std::nullptr_t) : LineLayoutSVGInline(nullptr
) { } | 27 explicit LineLayoutSVGTextPath(std::nullptr_t) : LineLayoutSVGInline(nullptr
) { } |
27 | 28 |
28 LineLayoutSVGTextPath() { } | 29 LineLayoutSVGTextPath() { } |
29 | 30 |
30 PassOwnPtr<PathPositionMapper> layoutPath() const | 31 std::unique_ptr<PathPositionMapper> layoutPath() const |
31 { | 32 { |
32 return toSVGTextPath()->layoutPath(); | 33 return toSVGTextPath()->layoutPath(); |
33 } | 34 } |
34 | 35 |
35 float calculateStartOffset(float pathLength) const | 36 float calculateStartOffset(float pathLength) const |
36 { | 37 { |
37 return toSVGTextPath()->calculateStartOffset(pathLength); | 38 return toSVGTextPath()->calculateStartOffset(pathLength); |
38 } | 39 } |
39 | 40 |
40 private: | 41 private: |
41 LayoutSVGTextPath* toSVGTextPath() | 42 LayoutSVGTextPath* toSVGTextPath() |
42 { | 43 { |
43 return toLayoutSVGTextPath(layoutObject()); | 44 return toLayoutSVGTextPath(layoutObject()); |
44 } | 45 } |
45 | 46 |
46 const LayoutSVGTextPath* toSVGTextPath() const | 47 const LayoutSVGTextPath* toSVGTextPath() const |
47 { | 48 { |
48 return toLayoutSVGTextPath(layoutObject()); | 49 return toLayoutSVGTextPath(layoutObject()); |
49 } | 50 } |
50 }; | 51 }; |
51 | 52 |
52 } // namespace blink | 53 } // namespace blink |
53 | 54 |
54 #endif // LineLayoutSVGTextPath_h | 55 #endif // LineLayoutSVGTextPath_h |
OLD | NEW |