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

Unified Diff: Source/core/platform/graphics/GlyphPageTreeNode.cpp

Issue 23446007: Use unicode-range to prevent unnecessary @font-face donwnloads (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase and add toSegmentedFontData() Created 7 years, 3 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
Index: Source/core/platform/graphics/GlyphPageTreeNode.cpp
diff --git a/Source/core/platform/graphics/GlyphPageTreeNode.cpp b/Source/core/platform/graphics/GlyphPageTreeNode.cpp
index 7a23d137d085c2cc762e9a031ec44be51a346d5e..23a66b7567877fb2c923a652fd6ac4ac08303174 100644
--- a/Source/core/platform/graphics/GlyphPageTreeNode.cpp
+++ b/Source/core/platform/graphics/GlyphPageTreeNode.cpp
@@ -226,6 +226,14 @@ void GlyphPageTreeNode::initializePage(const FontData* fontData, unsigned pageNu
int from = max(0, static_cast<int>(range.from()) - static_cast<int>(start));
int to = 1 + min(static_cast<int>(range.to()) - static_cast<int>(start), static_cast<int>(GlyphPage::size) - 1);
if (from < static_cast<int>(GlyphPage::size) && to > 0) {
+ // 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 (range.fontData()->isLoadingFallback()) {
+ range.fontData()->beginLoadIfNeeded();
+ continue;
+ }
+
if (haveGlyphs && !scratchPage) {
scratchPage = GlyphPage::createForMixedFontData(this);
pageToFill = scratchPage.get();
« no previous file with comments | « Source/core/platform/graphics/FontFallbackList.cpp ('k') | Source/core/platform/graphics/SegmentedFontData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698