Chromium Code Reviews| Index: Source/platform/fonts/FontFallbackList.cpp |
| diff --git a/Source/platform/fonts/FontFallbackList.cpp b/Source/platform/fonts/FontFallbackList.cpp |
| index 284f6124f883c5305bc5d99b66b7b8ddc7310688..b38c11b59c5a6c4a81565bac32abf1a0d85d3259 100644 |
| --- a/Source/platform/fonts/FontFallbackList.cpp |
| +++ b/Source/platform/fonts/FontFallbackList.cpp |
| @@ -46,6 +46,7 @@ FontFallbackList::FontFallbackList() |
| , m_familyIndex(0) |
| , m_generation(FontCache::fontCache()->generation()) |
| , m_hasLoadingFallback(false) |
| + , m_hasCustomFont(false) |
| { |
| } |
| @@ -58,6 +59,7 @@ void FontFallbackList::invalidate(PassRefPtrWillBeRawPtr<FontSelector> fontSelec |
| m_cachedPrimarySimpleFontData = 0; |
| m_familyIndex = 0; |
| m_hasLoadingFallback = false; |
| + m_hasCustomFont = false; |
| if (m_fontSelector != fontSelector) |
| m_fontSelector = fontSelector; |
| m_fontSelectorVersion = m_fontSelector ? m_fontSelector->version() : 0; |
| @@ -91,14 +93,15 @@ bool FontFallbackList::loadingCustomFonts() const |
| bool FontFallbackList::shouldSkipDrawing() const |
| { |
| - if (!m_hasLoadingFallback) |
| - return false; |
| - |
| - unsigned numFonts = m_fontList.size(); |
| - for (unsigned i = 0; i < numFonts; ++i) { |
| - if (m_fontList[i]->shouldSkipDrawing()) |
| - return true; |
| + if (m_hasLoadingFallback) { |
| + unsigned numFonts = m_fontList.size(); |
| + for (unsigned i = 0; i < numFonts; ++i) { |
| + if (m_fontList[i]->shouldSkipDrawing()) |
| + return true; |
| + } |
| } |
| + if (m_fontSelector) |
| + m_fontSelector->reportFirstNonBlankText(m_hasCustomFont); |
|
Bryan McQuade
2015/09/15 17:24:17
I'm still learning this code so I may be misunders
Kunihiko Sakamoto
2015/09/16 05:37:03
Agreed that reporting from shouldXXX is confusing.
|
| return false; |
| } |
| @@ -211,6 +214,8 @@ const FontData* FontFallbackList::fontDataAt(const FontDescription& fontDescript |
| m_fontList.append(result); |
| if (result->isLoadingFallback()) |
| m_hasLoadingFallback = true; |
| + if (result->isCustomFont()) |
| + m_hasCustomFont = true; |
| } |
| return result.get(); |
| } |