| 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" |
| 11 #include "third_party/icu/source/common/unicode/ubidi.h" | 11 #include "third_party/icu/source/common/unicode/ubidi.h" |
| 12 #include "third_party/icu/source/common/unicode/uscript.h" | 12 #include "third_party/icu/source/common/unicode/uscript.h" |
| 13 #include "ui/gfx/render_text.h" | 13 #include "ui/gfx/render_text.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 namespace i18n { | 16 namespace i18n { |
| 17 class BreakIterator; | 17 class BreakIterator; |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace gfx { | 21 namespace gfx { |
| 22 | 22 |
| 23 class Range; |
| 24 class RangeF; |
| 25 |
| 23 namespace internal { | 26 namespace internal { |
| 24 | 27 |
| 25 // TODO(ckocagil): Make Range a template class and RangeF an instance of it. | |
| 26 typedef std::pair<float, float> RangeF; | |
| 27 | |
| 28 // Applies std::round to the start and end values of the given RangeF. | 28 // Applies std::round to the start and end values of the given RangeF. |
| 29 Range GFX_EXPORT RoundRangeF(const RangeF& range_f); | 29 GFX_EXPORT Range RoundRangeF(const RangeF& range_f); |
| 30 | 30 |
| 31 struct GFX_EXPORT TextRunHarfBuzz { | 31 struct GFX_EXPORT TextRunHarfBuzz { |
| 32 TextRunHarfBuzz(); | 32 TextRunHarfBuzz(); |
| 33 ~TextRunHarfBuzz(); | 33 ~TextRunHarfBuzz(); |
| 34 | 34 |
| 35 // Returns the index of the first glyph that corresponds to the character at | 35 // Returns the index of the first glyph that corresponds to the character at |
| 36 // |pos|. | 36 // |pos|. |
| 37 size_t CharToGlyph(size_t pos) const; | 37 size_t CharToGlyph(size_t pos) const; |
| 38 | 38 |
| 39 // Returns the corresponding glyph range of the given character range. | 39 // Returns the corresponding glyph range of the given character range. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 // Fixed width of glyphs. This should only be set in test environments. | 182 // Fixed width of glyphs. This should only be set in test environments. |
| 183 uint8 glyph_width_for_test_; | 183 uint8 glyph_width_for_test_; |
| 184 | 184 |
| 185 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); | 185 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); |
| 186 }; | 186 }; |
| 187 | 187 |
| 188 } // namespace gfx | 188 } // namespace gfx |
| 189 | 189 |
| 190 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ | 190 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ |
| OLD | NEW |