Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: ui/gfx/render_text_harfbuzz.h

Issue 876873003: Add float version of gfx::Range (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed 2 Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/range/range_unittest.cc ('k') | ui/gfx/render_text_harfbuzz.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « ui/gfx/range/range_unittest.cc ('k') | ui/gfx/render_text_harfbuzz.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698