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

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

Issue 1925033002: RenderText: Don't default-construct gfx::Fonts unnecessarily (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove gfx::Font from RTM completely Created 4 years, 7 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 | « no previous file | 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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 namespace gfx { 27 namespace gfx {
28 28
29 class Range; 29 class Range;
30 class RangeF; 30 class RangeF;
31 31
32 namespace internal { 32 namespace internal {
33 33
34 struct GFX_EXPORT TextRunHarfBuzz { 34 struct GFX_EXPORT TextRunHarfBuzz {
35 TextRunHarfBuzz(); 35 // Construct the run with |template_font| since determining the details of a
36 // default-constructed gfx::Font is expensive, but it will always be replaced.
37 explicit TextRunHarfBuzz(const gfx::Font& template_font);
36 ~TextRunHarfBuzz(); 38 ~TextRunHarfBuzz();
37 39
38 // Returns the index of the first glyph that corresponds to the character at 40 // Returns the index of the first glyph that corresponds to the character at
39 // |pos|. 41 // |pos|.
40 size_t CharToGlyph(size_t pos) const; 42 size_t CharToGlyph(size_t pos) const;
41 43
42 // Returns the corresponding glyph range of the given character range. 44 // Returns the corresponding glyph range of the given character range.
43 // |range| is in text-space (0 corresponds to |GetDisplayText()[0]|). Returned 45 // |range| is in text-space (0 corresponds to |GetDisplayText()[0]|). Returned
44 // value is in run-space (0 corresponds to the first glyph in the run). 46 // value is in run-space (0 corresponds to the first glyph in the run).
45 Range CharRangeToGlyphRange(const Range& range) const; 47 Range CharRangeToGlyphRange(const Range& range) const;
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 276
275 // Fixed width of glyphs. This should only be set in test environments. 277 // Fixed width of glyphs. This should only be set in test environments.
276 float glyph_width_for_test_; 278 float glyph_width_for_test_;
277 279
278 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz); 280 DISALLOW_COPY_AND_ASSIGN(RenderTextHarfBuzz);
279 }; 281 };
280 282
281 } // namespace gfx 283 } // namespace gfx
282 284
283 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_ 285 #endif // UI_GFX_RENDER_TEXT_HARFBUZZ_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text_harfbuzz.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698