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

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

Issue 300623003: Fix the Char to Glyph mapping logic in RenderTextHarfBuzz (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add tests, fix implementation Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/gfx/render_text_harfbuzz.cc » ('j') | ui/gfx/render_text_harfbuzz.cc » ('J')
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 gfx { 15 namespace gfx {
16 16
17 namespace internal { 17 namespace internal {
18 18
19 struct TextRunHarfBuzz { 19 struct GFX_EXPORT TextRunHarfBuzz {
20 TextRunHarfBuzz(); 20 TextRunHarfBuzz();
21 ~TextRunHarfBuzz(); 21 ~TextRunHarfBuzz();
22 22
23 // Returns the index of the first glyph that corresponds to the character at 23 // Returns the index of the first glyph that corresponds to the character at
24 // |pos|. 24 // |pos|.
25 size_t CharToGlyph(size_t pos) const; 25 size_t CharToGlyph(size_t pos) const;
26 26
27 // Returns the corresponding glyph range of the given character range. 27 // Returns the corresponding glyph range of the given character range.
28 // |range| is in text-space (0 corresponds to |GetLayoutText()[0]|). Returned 28 // |range| is in text-space (0 corresponds to |GetLayoutText()[0]|). Returned
29 // value is in run-space (0 corresponds to the first glyph in the run). 29 // value is in run-space (0 corresponds to the first glyph in the run).
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 std::vector<int32_t> logical_to_visual_; 117 std::vector<int32_t> logical_to_visual_;
118 118
119 bool needs_layout_; 119 bool needs_layout_;
120 120
121 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); 121 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz);
122 }; 122 };
123 123
124 } // namespace gfx 124 } // namespace gfx
125 125
126 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ 126 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text_harfbuzz.cc » ('j') | ui/gfx/render_text_harfbuzz.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698