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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "third_party/harfbuzz-ng/src/hb.h" | 10 #include "third_party/harfbuzz-ng/src/hb.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 size_t TextIndexToDisplayIndex(size_t index) override; | 155 size_t TextIndexToDisplayIndex(size_t index) override; |
156 size_t DisplayIndexToTextIndex(size_t index) override; | 156 size_t DisplayIndexToTextIndex(size_t index) override; |
157 bool IsValidCursorIndex(size_t index) override; | 157 bool IsValidCursorIndex(size_t index) override; |
158 void OnLayoutTextAttributeChanged(bool text_changed) override; | 158 void OnLayoutTextAttributeChanged(bool text_changed) override; |
159 void OnDisplayTextAttributeChanged() override; | 159 void OnDisplayTextAttributeChanged() override; |
160 void EnsureLayout() override; | 160 void EnsureLayout() override; |
161 void DrawVisualText(Canvas* canvas) override; | 161 void DrawVisualText(Canvas* canvas) override; |
162 | 162 |
163 private: | 163 private: |
164 friend class RenderTextTest; | 164 friend class RenderTextTest; |
| 165 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_HorizontalAlignment); |
165 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_NormalWidth); | 166 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_NormalWidth); |
166 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_RunDirection); | 167 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_RunDirection); |
167 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_HorizontalPositions); | 168 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_HorizontalPositions); |
168 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, | 169 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, |
169 HarfBuzz_TextPositionWithFractionalSize); | 170 HarfBuzz_TextPositionWithFractionalSize); |
170 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByUnicodeBlocks); | 171 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByUnicodeBlocks); |
171 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByEmoji); | 172 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByEmoji); |
172 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemeCases); | 173 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemeCases); |
173 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemePartition); | 174 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemePartition); |
174 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_NonExistentFont); | 175 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_NonExistentFont); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 264 |
264 // Fixed width of glyphs. This should only be set in test environments. | 265 // Fixed width of glyphs. This should only be set in test environments. |
265 float glyph_width_for_test_; | 266 float glyph_width_for_test_; |
266 | 267 |
267 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); | 268 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); |
268 }; | 269 }; |
269 | 270 |
270 } // namespace gfx | 271 } // namespace gfx |
271 | 272 |
272 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 273 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
OLD | NEW |