Chromium Code Reviews| Index: Source/platform/fonts/Font.cpp |
| diff --git a/Source/platform/fonts/Font.cpp b/Source/platform/fonts/Font.cpp |
| index 722ac9d117e28d2e0fc9f9f9ea65a5d1f096aa98..c3308777fbdfbb7d3c7f4fa742a7ca980107d99d 100644 |
| --- a/Source/platform/fonts/Font.cpp |
| +++ b/Source/platform/fonts/Font.cpp |
| @@ -150,10 +150,15 @@ float Font::width(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFo |
| } |
| bool hasKerningOrLigatures = fontDescription().typesettingFeatures() & (Kerning | Ligatures); |
| - bool hasWordSpacingOrLetterSpacing = fontDescription().wordSpacing() || fontDescription().letterSpacing(); |
| - float* cacheEntry = m_fontFallbackList->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasKerningOrLigatures, hasWordSpacingOrLetterSpacing, glyphOverflow); |
| - if (cacheEntry && !std::isnan(*cacheEntry)) |
| - return *cacheEntry; |
| + float* cacheEntry; |
| + if (codePathToUse == ComplexPath || hasKerningOrLigatures) { |
|
Dominik Röttsches
2014/03/21 06:24:48
Now the decision on whether the cache is used is i
|
| + bool hasWordSpacingOrLetterSpacing = fontDescription().wordSpacing() || fontDescription().letterSpacing(); |
| + cacheEntry = m_fontFallbackList->widthCache().add(run, std::numeric_limits<float>::quiet_NaN(), hasWordSpacingOrLetterSpacing, glyphOverflow); |
| + if (cacheEntry && !std::isnan(*cacheEntry)) |
| + return *cacheEntry; |
| + } else { |
| + cacheEntry = 0; |
| + } |
| float result; |
| if (codePathToUse == ComplexPath) |