Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: third_party/WebKit/Source/core/layout/api/LineLayoutSVGTextPath.h

Issue 1683903004: Factor out the <textPath> positioning mapping code into a helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10
11 namespace blink { 11 namespace blink {
12 12
13 class LineLayoutSVGTextPath : public LineLayoutSVGInline { 13 class LineLayoutSVGTextPath : public LineLayoutSVGInline {
14 public: 14 public:
15 explicit LineLayoutSVGTextPath(LayoutSVGTextPath* layoutSVGTextPath) 15 explicit LineLayoutSVGTextPath(LayoutSVGTextPath* layoutSVGTextPath)
16 : LineLayoutSVGInline(layoutSVGTextPath) 16 : LineLayoutSVGInline(layoutSVGTextPath)
17 { 17 {
18 } 18 }
19 19
20 explicit LineLayoutSVGTextPath(const LineLayoutItem& item) 20 explicit LineLayoutSVGTextPath(const LineLayoutItem& item)
21 : LineLayoutSVGInline(item) 21 : LineLayoutSVGInline(item)
22 { 22 {
23 ASSERT(!item || item.isSVGTextPath()); 23 ASSERT(!item || item.isSVGTextPath());
24 } 24 }
25 25
26 explicit LineLayoutSVGTextPath(std::nullptr_t) : LineLayoutSVGInline(nullptr ) { } 26 explicit LineLayoutSVGTextPath(std::nullptr_t) : LineLayoutSVGInline(nullptr ) { }
27 27
28 LineLayoutSVGTextPath() { } 28 LineLayoutSVGTextPath() { }
29 29
30 Path layoutPath() const 30 PassOwnPtr<PathPositionMapper> layoutPath() const
31 { 31 {
32 return toSVGTextPath()->layoutPath(); 32 return toSVGTextPath()->layoutPath();
33 } 33 }
34 34
35 float calculateStartOffset(float pathLength) const 35 float calculateStartOffset(float pathLength) const
36 { 36 {
37 return toSVGTextPath()->calculateStartOffset(pathLength); 37 return toSVGTextPath()->calculateStartOffset(pathLength);
38 } 38 }
39 39
40 private: 40 private:
41 LayoutSVGTextPath* toSVGTextPath() 41 LayoutSVGTextPath* toSVGTextPath()
42 { 42 {
43 return toLayoutSVGTextPath(layoutObject()); 43 return toLayoutSVGTextPath(layoutObject());
44 } 44 }
45 45
46 const LayoutSVGTextPath* toSVGTextPath() const 46 const LayoutSVGTextPath* toSVGTextPath() const
47 { 47 {
48 return toLayoutSVGTextPath(layoutObject()); 48 return toLayoutSVGTextPath(layoutObject());
49 } 49 }
50 }; 50 };
51 51
52 } // namespace blink 52 } // namespace blink
53 53
54 #endif // LineLayoutSVGTextPath_h 54 #endif // LineLayoutSVGTextPath_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/svg/LayoutSVGTextPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698