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

Unified Diff: Source/core/layout/line/BreakingContextInlineHeaders.h

Issue 1153173011: Force glyph overflow calculation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: More rebaselines 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
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/platform/fonts/Character.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/line/BreakingContextInlineHeaders.h
diff --git a/Source/core/layout/line/BreakingContextInlineHeaders.h b/Source/core/layout/line/BreakingContextInlineHeaders.h
index 7127ed536fed6d72317e486ad18a462668589db4..872c379a4897da50c82a8be1341df502e048a916 100644
--- a/Source/core/layout/line/BreakingContextInlineHeaders.h
+++ b/Source/core/layout/line/BreakingContextInlineHeaders.h
@@ -511,15 +511,18 @@ ALWAYS_INLINE TextDirection textDirectionFromUnicode(WTF::Unicode::Direction dir
ALWAYS_INLINE float textWidth(LayoutText* text, unsigned from, unsigned len, const Font& font, float xPos, bool collapseWhiteSpace, HashSet<const SimpleFontData*>* fallbackFonts = nullptr)
{
- GlyphOverflow glyphOverflow;
- if ((!from && len == text->textLength()) || text->style()->hasTextCombine())
- return text->width(from, len, font, xPos, text->style()->direction(), fallbackFonts, &glyphOverflow);
+ if ((!from && len == text->textLength()) || text->style()->hasTextCombine()) {
+ GlyphOverflow glyphOverflow;
+ return text->width(from, len, font, xPos, text->style()->direction(), fallbackFonts,
+ // LayoutText caches fallbackFonts and glyphOverflow together, and requires them to be both null or both non-null.
+ fallbackFonts ? &glyphOverflow : nullptr);
+ }
TextRun run = constructTextRun(text, font, text, from, len, text->styleRef());
run.setCodePath(text->canUseSimpleFontCodePath() ? TextRun::ForceSimple : TextRun::ForceComplex);
run.setTabSize(!collapseWhiteSpace, text->style()->tabSize());
run.setXPos(xPos);
- return font.width(run, fallbackFonts, &glyphOverflow);
+ return font.width(run, fallbackFonts, nullptr);
}
inline bool BreakingContext::handleText(WordMeasurements& wordMeasurements, bool& hyphenated)
« no previous file with comments | « Source/core/layout/LayoutBlockFlowLine.cpp ('k') | Source/platform/fonts/Character.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698