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

Unified Diff: Source/platform/fonts/WidthCache.h

Issue 206793005: Expand WidthCache for complex text width queries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressing Dominiks comments Created 6 years, 9 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/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/WidthCache.h
diff --git a/Source/platform/fonts/WidthCache.h b/Source/platform/fonts/WidthCache.h
index 813d8e61d0e9700c72267f3d6ac196aa7ca98fcf..78b093fb6a66b2bfda0c786205b34b486bd8da13 100644
--- a/Source/platform/fonts/WidthCache.h
+++ b/Source/platform/fonts/WidthCache.h
@@ -119,20 +119,8 @@ public:
{
}
- float* add(const TextRun& run, float entry, bool hasKerningOrLigatures, bool hasWordSpacingOrLetterSpacing, GlyphOverflow* glyphOverflow)
+ float* add(const TextRun& run, float entry)
{
- // The width cache is not really profitable unless we're doing expensive glyph transformations.
- if (!hasKerningOrLigatures)
- return 0;
- // Word spacing and letter spacing can change the width of a word.
- if (hasWordSpacingOrLetterSpacing)
- return 0;
- // Since this is just a width cache, we don't have enough information to satisfy glyph queries.
- if (glyphOverflow)
- return 0;
- // If we allow tabs and a tab occurs inside a word, the width of the word varies based on its position on the line.
- if (run.allowTabs())
- return 0;
if (static_cast<unsigned>(run.length()) > SmallStringKey::capacity())
return 0;
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698