Chromium Code Reviews| Index: Source/platform/fonts/GlyphPageTreeNode.cpp |
| diff --git a/Source/platform/fonts/GlyphPageTreeNode.cpp b/Source/platform/fonts/GlyphPageTreeNode.cpp |
| index 1fb43ad5c4ebf781244550f33d487d374ca333bf..3f0537f32b5a5fcb870a54c0ee483117b59d30eb 100644 |
| --- a/Source/platform/fonts/GlyphPageTreeNode.cpp |
| +++ b/Source/platform/fonts/GlyphPageTreeNode.cpp |
| @@ -223,12 +223,14 @@ void GlyphPageTreeNode::initializePage(const FontData* fontData, unsigned pageNu |
| if (from >= static_cast<int>(GlyphPage::size) || to <= 0) |
| continue; |
| - // If this is a custom font needs to be loaded, kick off |
| - // the load here, and do not fill the page so that |
| - // font fallback is used while loading. |
| + // If this is a custom font needs to be loaded, do not fill |
| + // the page so that font fallback is used while loading. |
| RefPtr<CustomFontData> customData = range.fontData()->customFontData(); |
| if (customData && customData->isLoadingFallback()) { |
| - customData->beginLoadIfNeeded(); |
| + for (int j = from; j < to; j++) { |
|
eae
2014/04/23 18:38:39
Here and elsewhere shouldn't j (and from) be unsig
Kunihiko Sakamoto
2014/04/24 01:49:24
I'd prefer to keep them int, as calculation of |fr
|
| + m_page->setCustomFontToLoad(j, customData.get()); |
| + haveGlyphs = true; |
| + } |
| continue; |
| } |
| @@ -272,12 +274,19 @@ void GlyphPageTreeNode::initializePage(const FontData* fontData, unsigned pageNu |
| // has added anything. |
| bool newGlyphs = false; |
| for (unsigned i = 0; i < GlyphPage::size; i++) { |
| - if (parentPage->glyphAt(i)) |
| + if (parentPage->glyphAt(i)) { |
| m_page->setGlyphDataForIndex(i, parentPage->glyphDataForIndex(i)); |
| - else if (fallbackPage->glyphAt(i)) { |
| + } else if (fallbackPage->glyphAt(i)) { |
| m_page->setGlyphDataForIndex(i, fallbackPage->glyphDataForIndex(i)); |
| newGlyphs = true; |
| } |
| + |
| + if (parentPage->customFontToLoadAt(i)) { |
| + m_page->setCustomFontToLoad(i, parentPage->customFontToLoadAt(i)); |
| + } else if (fallbackPage->customFontToLoadAt(i) && !parentPage->glyphAt(i)) { |
| + m_page->setCustomFontToLoad(i, fallbackPage->customFontToLoadAt(i)); |
| + newGlyphs = true; |
| + } |
| } |
| if (!newGlyphs) |