OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_GFX_RENDER_TEXT_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <string> | 10 #include <string> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 }; | 156 }; |
157 | 157 |
158 // A line of layout text, comprised of a line segment list and some metrics. | 158 // A line of layout text, comprised of a line segment list and some metrics. |
159 struct Line { | 159 struct Line { |
160 Line(); | 160 Line(); |
161 ~Line(); | 161 ~Line(); |
162 | 162 |
163 // Segments that make up this line in visual order. | 163 // Segments that make up this line in visual order. |
164 std::vector<LineSegment> segments; | 164 std::vector<LineSegment> segments; |
165 | 165 |
166 // A line size is the sum of segment widths and the maximum of segment | 166 // The sum of segment widths and the maximum of segment heights. |
167 // heights. | 167 SizeF size; |
168 Size size; | |
169 | 168 |
170 // Sum of preceding lines' heights. | 169 // Sum of preceding lines' heights. |
171 int preceding_heights; | 170 int preceding_heights; |
172 | 171 |
173 // Maximum baseline of all segments on this line. | 172 // Maximum baseline of all segments on this line. |
174 int baseline; | 173 int baseline; |
175 }; | 174 }; |
176 | 175 |
177 // Creates an SkTypeface from a font |family| name and a |gfx::Font::FontStyle|. | 176 // Creates an SkTypeface from a font |family| name and a |gfx::Font::FontStyle|. |
178 // May return NULL. | 177 // May return NULL. |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 // Lines computed by EnsureLayout. These should be invalidated with | 720 // Lines computed by EnsureLayout. These should be invalidated with |
722 // ResetLayout and on |display_rect_| changes. | 721 // ResetLayout and on |display_rect_| changes. |
723 std::vector<internal::Line> lines_; | 722 std::vector<internal::Line> lines_; |
724 | 723 |
725 DISALLOW_COPY_AND_ASSIGN(RenderText); | 724 DISALLOW_COPY_AND_ASSIGN(RenderText); |
726 }; | 725 }; |
727 | 726 |
728 } // namespace gfx | 727 } // namespace gfx |
729 | 728 |
730 #endif // UI_GFX_RENDER_TEXT_H_ | 729 #endif // UI_GFX_RENDER_TEXT_H_ |
OLD | NEW |