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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 }; | 73 }; |
74 | 74 |
75 } // namespace internal | 75 } // namespace internal |
76 | 76 |
77 class GFX_EXPORT RenderTextHarfBuzz : public RenderText { | 77 class GFX_EXPORT RenderTextHarfBuzz : public RenderText { |
78 public: | 78 public: |
79 RenderTextHarfBuzz(); | 79 RenderTextHarfBuzz(); |
80 virtual ~RenderTextHarfBuzz(); | 80 virtual ~RenderTextHarfBuzz(); |
81 | 81 |
82 // Overridden from RenderText. | 82 // Overridden from RenderText. |
83 virtual Size GetStringSize() OVERRIDE; | 83 virtual Size GetStringSize() override; |
84 virtual SizeF GetStringSizeF() OVERRIDE; | 84 virtual SizeF GetStringSizeF() override; |
85 virtual SelectionModel FindCursorPosition(const Point& point) OVERRIDE; | 85 virtual SelectionModel FindCursorPosition(const Point& point) override; |
86 virtual std::vector<FontSpan> GetFontSpansForTesting() OVERRIDE; | 86 virtual std::vector<FontSpan> GetFontSpansForTesting() override; |
87 virtual Range GetGlyphBounds(size_t index) OVERRIDE; | 87 virtual Range GetGlyphBounds(size_t index) override; |
88 | 88 |
89 protected: | 89 protected: |
90 // Overridden from RenderText. | 90 // Overridden from RenderText. |
91 virtual int GetLayoutTextBaseline() OVERRIDE; | 91 virtual int GetLayoutTextBaseline() override; |
92 virtual SelectionModel AdjacentCharSelectionModel( | 92 virtual SelectionModel AdjacentCharSelectionModel( |
93 const SelectionModel& selection, | 93 const SelectionModel& selection, |
94 VisualCursorDirection direction) OVERRIDE; | 94 VisualCursorDirection direction) override; |
95 virtual SelectionModel AdjacentWordSelectionModel( | 95 virtual SelectionModel AdjacentWordSelectionModel( |
96 const SelectionModel& selection, | 96 const SelectionModel& selection, |
97 VisualCursorDirection direction) OVERRIDE; | 97 VisualCursorDirection direction) override; |
98 virtual std::vector<Rect> GetSubstringBounds(const Range& range) OVERRIDE; | 98 virtual std::vector<Rect> GetSubstringBounds(const Range& range) override; |
99 virtual size_t TextIndexToLayoutIndex(size_t index) const OVERRIDE; | 99 virtual size_t TextIndexToLayoutIndex(size_t index) const override; |
100 virtual size_t LayoutIndexToTextIndex(size_t index) const OVERRIDE; | 100 virtual size_t LayoutIndexToTextIndex(size_t index) const override; |
101 virtual bool IsValidCursorIndex(size_t index) OVERRIDE; | 101 virtual bool IsValidCursorIndex(size_t index) override; |
102 virtual void ResetLayout() OVERRIDE; | 102 virtual void ResetLayout() override; |
103 virtual void EnsureLayout() OVERRIDE; | 103 virtual void EnsureLayout() override; |
104 virtual void DrawVisualText(Canvas* canvas) OVERRIDE; | 104 virtual void DrawVisualText(Canvas* canvas) override; |
105 | 105 |
106 private: | 106 private: |
107 friend class RenderTextTest; | 107 friend class RenderTextTest; |
108 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_RunDirection); | 108 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_RunDirection); |
109 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByUnicodeBlocks); | 109 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_BreakRunsByUnicodeBlocks); |
110 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemeCases); | 110 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemeCases); |
111 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemePartition); | 111 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_SubglyphGraphemePartition); |
112 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_NonExistentFont); | 112 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_NonExistentFont); |
113 | 113 |
114 // Return the run index that contains the argument; or the length of the | 114 // Return the run index that contains the argument; or the length of the |
(...skipping 29 matching lines...) Expand all Loading... |
144 // ICU grapheme iterator for the layout text. Valid when |!needs_layout_|. Can | 144 // ICU grapheme iterator for the layout text. Valid when |!needs_layout_|. Can |
145 // be NULL in case of an error. | 145 // be NULL in case of an error. |
146 scoped_ptr<base::i18n::BreakIterator> grapheme_iterator_; | 146 scoped_ptr<base::i18n::BreakIterator> grapheme_iterator_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); | 148 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); |
149 }; | 149 }; |
150 | 150 |
151 } // namespace gfx | 151 } // namespace gfx |
152 | 152 |
153 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 153 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
OLD | NEW |