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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 std::vector<Rect> GetSubstringBounds(const Range& range) override; | 106 std::vector<Rect> GetSubstringBounds(const Range& range) override; |
107 size_t TextIndexToLayoutIndex(size_t index) const override; | 107 size_t TextIndexToLayoutIndex(size_t index) const override; |
108 size_t LayoutIndexToTextIndex(size_t index) const override; | 108 size_t LayoutIndexToTextIndex(size_t index) const override; |
109 bool IsValidCursorIndex(size_t index) override; | 109 bool IsValidCursorIndex(size_t index) override; |
110 void ResetLayout() override; | 110 void ResetLayout() override; |
111 void EnsureLayout() override; | 111 void EnsureLayout() override; |
112 void DrawVisualText(Canvas* canvas) override; | 112 void DrawVisualText(Canvas* canvas) override; |
113 | 113 |
114 private: | 114 private: |
115 friend class RenderTextTest; | 115 friend class RenderTextTest; |
| 116 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_HorizontalAlignment); |
116 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_NormalWidth); | 117 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_NormalWidth); |
117 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_RunDirection); | 118 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_RunDirection); |
118 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByUnicodeBlocks); | 119 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByUnicodeBlocks); |
119 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByEmoji); | 120 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByEmoji); |
120 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemeCases); | 121 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemeCases); |
121 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemePartition); | 122 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemePartition); |
122 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_NonExistentFont); | 123 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_NonExistentFont); |
123 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_UniscribeFallback); | 124 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_UniscribeFallback); |
124 | 125 |
125 // Specify the width of a glyph for test. The width of glyphs is very | 126 // Specify the width of a glyph for test. The width of glyphs is very |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 | 182 |
182 // Fixed width of glyphs. This should only be set in test environments. | 183 // Fixed width of glyphs. This should only be set in test environments. |
183 uint8 glyph_width_for_test_; | 184 uint8 glyph_width_for_test_; |
184 | 185 |
185 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); | 186 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); |
186 }; | 187 }; |
187 | 188 |
188 } // namespace gfx | 189 } // namespace gfx |
189 | 190 |
190 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 191 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
OLD | NEW |