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

Unified Diff: ui/gfx/render_text_harfbuzz.h

Issue 1070223004: Stop combining text runs which are connected by 'COMMON' blocks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix broken unittest. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: ui/gfx/render_text_harfbuzz.h
diff --git a/ui/gfx/render_text_harfbuzz.h b/ui/gfx/render_text_harfbuzz.h
index 6d8fa8d962a13e7067e0d2f759cf8f9dbdb89916..e8b28e430e4a1c5dc7f3a7fab2709fb6573f8ab5 100644
--- a/ui/gfx/render_text_harfbuzz.h
+++ b/ui/gfx/render_text_harfbuzz.h
@@ -54,6 +54,10 @@ struct GFX_EXPORT TextRunHarfBuzz {
// Returns whether the given shaped run contains any missing glyphs.
bool HasMissingGlyphs() const;
+ // Returns the glyph width for the given character range. |char_range| is in
+ // text-space (0 corresponds to |GetDisplayText()[0]|).
+ SkScalar GetGlyphWidthForCharRange(const Range& char_range) const;
+
float width;
float preceding_run_widths;
Range range;
@@ -115,6 +119,9 @@ class TextRunList {
// Do not use this when multiline is enabled.
float width() const { return width_; }
+ // Get the run index applicable to |position| (at or preceeding |position|).
+ size_t GetRunIndexAt(size_t position) const;
+
private:
// Text runs in logical order.
ScopedVector<TextRunHarfBuzz> runs_;
@@ -179,6 +186,10 @@ class GFX_EXPORT RenderTextHarfBuzz : public RenderText {
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_NonExistentFont);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_UniscribeFallback);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_UnicodeFallback);
+ FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_LineBreakerBehavior);
+ FRIEND_TEST_ALL_PREFIXES(RenderTextTest,
+ Multiline_SurrogatePairsOrCombiningChars);
+ FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_ZeroWidthChars);
// Specify the width of a glyph for test. The width of glyphs is very
// platform-dependent and environment-dependent. Otherwise multiline test

Powered by Google App Engine
This is Rietveld 408576698