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

Unified Diff: Source/platform/fonts/GlyphPageTreeNode.cpp

Issue 243453003: Proper unicode-range font loading behavior (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/GlyphPage.h ('k') | Source/platform/fonts/GlyphPageTreeNodeTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/platform/fonts/GlyphPage.h ('k') | Source/platform/fonts/GlyphPageTreeNodeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698