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

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: RangeF unit tests 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
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 namespace internal { 23 namespace internal {
24 24
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. 25 // Applies std::round to the start and end values of the given RangeF.
29 Range GFX_EXPORT RoundRangeF(const RangeF& range_f); 26 GFX_EXPORT Range RoundRangeF(const RangeF& range_f);
30 27
31 struct GFX_EXPORT TextRunHarfBuzz { 28 struct GFX_EXPORT TextRunHarfBuzz {
32 TextRunHarfBuzz(); 29 TextRunHarfBuzz();
33 ~TextRunHarfBuzz(); 30 ~TextRunHarfBuzz();
34 31
35 // Returns the index of the first glyph that corresponds to the character at 32 // Returns the index of the first glyph that corresponds to the character at
36 // |pos|. 33 // |pos|.
37 size_t CharToGlyph(size_t pos) const; 34 size_t CharToGlyph(size_t pos) const;
38 35
39 // Returns the corresponding glyph range of the given character range. 36 // Returns the corresponding glyph range of the given character range.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // ICU grapheme iterator for the layout text. Valid when |!needs_layout_|. Can 164 // ICU grapheme iterator for the layout text. Valid when |!needs_layout_|. Can
168 // be NULL in case of an error. 165 // be NULL in case of an error.
169 scoped_ptr<base::i18n::BreakIterator> grapheme_iterator_; 166 scoped_ptr<base::i18n::BreakIterator> grapheme_iterator_;
170 167
171 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); 168 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz);
172 }; 169 };
173 170
174 } // namespace gfx 171 } // namespace gfx
175 172
176 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ 173 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698