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

Side by Side Diff: Source/platform/fonts/Font.cpp

Issue 171823002: Make text visible when font loading takes longer than 3 seconds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/Font.h ('k') | Source/platform/fonts/FontData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2006, 2010, 2011 Apple Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (!m_fontFallbackList) 100 if (!m_fontFallbackList)
101 m_fontFallbackList = FontFallbackList::create(); 101 m_fontFallbackList = FontFallbackList::create();
102 m_fontFallbackList->invalidate(fontSelector); 102 m_fontFallbackList->invalidate(fontSelector);
103 } 103 }
104 104
105 void Font::drawText(GraphicsContext* context, const TextRunPaintInfo& runInfo, c onst FloatPoint& point, CustomFontNotReadyAction customFontNotReadyAction) const 105 void Font::drawText(GraphicsContext* context, const TextRunPaintInfo& runInfo, c onst FloatPoint& point, CustomFontNotReadyAction customFontNotReadyAction) const
106 { 106 {
107 // Don't draw anything while we are using custom fonts that are in the proce ss of loading, 107 // Don't draw anything while we are using custom fonts that are in the proce ss of loading,
108 // except if the 'force' argument is set to true (in which case it will use a fallback 108 // except if the 'force' argument is set to true (in which case it will use a fallback
109 // font). 109 // font).
110 if (loadingCustomFonts() && customFontNotReadyAction == DoNotPaintIfFontNotR eady) 110 if (shouldSkipDrawing() && customFontNotReadyAction == DoNotPaintIfFontNotRe ady)
111 return; 111 return;
112 112
113 CodePath codePathToUse = codePath(runInfo.run); 113 CodePath codePathToUse = codePath(runInfo.run);
114 // FIXME: Use the fast code path once it handles partial runs with kerning a nd ligatures. See http://webkit.org/b/100050 114 // FIXME: Use the fast code path once it handles partial runs with kerning a nd ligatures. See http://webkit.org/b/100050
115 if (codePathToUse != ComplexPath && fontDescription().typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length())) 115 if (codePathToUse != ComplexPath && fontDescription().typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
116 codePathToUse = ComplexPath; 116 codePathToUse = ComplexPath;
117 117
118 if (codePathToUse != ComplexPath) 118 if (codePathToUse != ComplexPath)
119 return drawSimpleText(context, runInfo, point); 119 return drawSimpleText(context, runInfo, point);
120 120
121 return drawComplexText(context, runInfo, point); 121 return drawComplexText(context, runInfo, point);
122 } 122 }
123 123
124 void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& r unInfo, const AtomicString& mark, const FloatPoint& point) const 124 void Font::drawEmphasisMarks(GraphicsContext* context, const TextRunPaintInfo& r unInfo, const AtomicString& mark, const FloatPoint& point) const
125 { 125 {
126 if (loadingCustomFonts()) 126 if (shouldSkipDrawing())
127 return; 127 return;
128 128
129 CodePath codePathToUse = codePath(runInfo.run); 129 CodePath codePathToUse = codePath(runInfo.run);
130 // FIXME: Use the fast code path once it handles partial runs with kerning a nd ligatures. See http://webkit.org/b/100050 130 // FIXME: Use the fast code path once it handles partial runs with kerning a nd ligatures. See http://webkit.org/b/100050
131 if (codePathToUse != ComplexPath && fontDescription().typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length())) 131 if (codePathToUse != ComplexPath && fontDescription().typesettingFeatures() && (runInfo.from || runInfo.to != runInfo.run.length()))
132 codePathToUse = ComplexPath; 132 codePathToUse = ComplexPath;
133 133
134 if (codePathToUse != ComplexPath) 134 if (codePathToUse != ComplexPath)
135 drawEmphasisMarksForSimpleText(context, runInfo, mark, point); 135 drawEmphasisMarksForSimpleText(context, runInfo, mark, point);
136 else 136 else
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 if (delta <= 0) 818 if (delta <= 0)
819 break; 819 break;
820 } 820 }
821 } 821 }
822 } 822 }
823 823
824 return offset; 824 return offset;
825 } 825 }
826 826
827 } 827 }
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.h ('k') | Source/platform/fonts/FontData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698