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 UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
6 #define UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 6 #define UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 void EnsureLayoutRunList(); | 257 void EnsureLayoutRunList(); |
258 | 258 |
259 // ICU grapheme iterator for the layout text. Can be NULL in case of an error. | 259 // ICU grapheme iterator for the layout text. Can be NULL in case of an error. |
260 base::i18n::BreakIterator* GetGraphemeIterator(); | 260 base::i18n::BreakIterator* GetGraphemeIterator(); |
261 | 261 |
262 // Returns the current run list, |display_run_list_| if the text is | 262 // Returns the current run list, |display_run_list_| if the text is |
263 // elided, or |layout_run_list_| otherwise. | 263 // elided, or |layout_run_list_| otherwise. |
264 internal::TextRunList* GetRunList(); | 264 internal::TextRunList* GetRunList(); |
265 const internal::TextRunList* GetRunList() const; | 265 const internal::TextRunList* GetRunList() const; |
266 | 266 |
267 // RenderText: | |
268 bool GetStyledStringForRange(const Range& range, | |
tapted
2016/09/21 04:06:55
move to protected
| |
269 NativeStyledString str) const override; | |
270 | |
267 // Text run list for |layout_text_| and |display_text_|. | 271 // Text run list for |layout_text_| and |display_text_|. |
268 // |display_run_list_| is created only when the text is elided. | 272 // |display_run_list_| is created only when the text is elided. |
269 internal::TextRunList layout_run_list_; | 273 internal::TextRunList layout_run_list_; |
270 std::unique_ptr<internal::TextRunList> display_run_list_; | 274 std::unique_ptr<internal::TextRunList> display_run_list_; |
271 | 275 |
272 bool update_layout_run_list_ : 1; | 276 bool update_layout_run_list_ : 1; |
273 bool update_display_run_list_ : 1; | 277 bool update_display_run_list_ : 1; |
274 bool update_grapheme_iterator_ : 1; | 278 bool update_grapheme_iterator_ : 1; |
275 bool update_display_text_ : 1; | 279 bool update_display_text_ : 1; |
276 | 280 |
277 // ICU grapheme iterator for the layout text. Use GetGraphemeIterator() | 281 // ICU grapheme iterator for the layout text. Use GetGraphemeIterator() |
278 // to access the iterator. | 282 // to access the iterator. |
279 std::unique_ptr<base::i18n::BreakIterator> grapheme_iterator_; | 283 std::unique_ptr<base::i18n::BreakIterator> grapheme_iterator_; |
280 | 284 |
281 // The total size of the layouted text. | 285 // The total size of the layouted text. |
282 SizeF total_size_; | 286 SizeF total_size_; |
283 | 287 |
284 // Fixed width of glyphs. This should only be set in test environments. | 288 // Fixed width of glyphs. This should only be set in test environments. |
285 float glyph_width_for_test_; | 289 float glyph_width_for_test_; |
286 | 290 |
287 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); | 291 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); |
288 }; | 292 }; |
289 | 293 |
290 } // namespace gfx | 294 } // namespace gfx |
291 | 295 |
292 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 296 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
OLD | NEW |