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

Side by Side Diff: Source/core/css/CSSFontSelector.cpp

Issue 137253005: [Font Load Events] Partial implementation of SetClass operations for FontFaceSet (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix callback arguments Created 6 years, 11 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/core/css/CSSFontSelector.h ('k') | Source/core/css/CSSSegmentedFontFaceCache.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) 2007, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2011 Apple Inc. All rights reserved.
3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 3 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return face->getFontData(fontDescription); 197 return face->getFontData(fontDescription);
198 198
199 // Try to return the correct font based off our settings, in case we were ha nded the generic font family name. 199 // Try to return the correct font based off our settings, in case we were ha nded the generic font family name.
200 AtomicString settingsFamilyName = familyNameFromSettings(m_genericFontFamily Settings, fontDescription, familyName); 200 AtomicString settingsFamilyName = familyNameFromSettings(m_genericFontFamily Settings, fontDescription, familyName);
201 if (settingsFamilyName.isEmpty()) 201 if (settingsFamilyName.isEmpty())
202 return 0; 202 return 0;
203 203
204 return FontCache::fontCache()->getFontData(fontDescription, settingsFamilyNa me); 204 return FontCache::fontCache()->getFontData(fontDescription, settingsFamilyNa me);
205 } 205 }
206 206
207 CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDe scription, const AtomicString& familyName)
208 {
209 return m_cssSegmentedFontFaceCache.get(fontDescription, familyName);
210 }
211
212 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, co nst AtomicString& family) 207 void CSSFontSelector::willUseFontData(const FontDescription& fontDescription, co nst AtomicString& family)
213 { 208 {
214 CSSSegmentedFontFace* face = getFontFace(fontDescription, family); 209 CSSSegmentedFontFace* face = m_cssSegmentedFontFaceCache.get(fontDescription , family);
215 if (face) 210 if (face)
216 face->willUseFontData(fontDescription); 211 face->willUseFontData(fontDescription);
217 } 212 }
218 213
219 void CSSFontSelector::clearDocument() 214 void CSSFontSelector::clearDocument()
220 { 215 {
221 m_fontLoader.clearResourceFetcher(); 216 m_fontLoader.clearResourceFetcher();
222 m_document = 0; 217 m_document = 0;
223 } 218 }
224 219
225 void CSSFontSelector::beginLoadingFontSoon(FontResource* font) 220 void CSSFontSelector::beginLoadingFontSoon(FontResource* font)
226 { 221 {
227 m_fontLoader.addFontToBeginLoading(font); 222 m_fontLoader.addFontToBeginLoading(font);
228 } 223 }
229 224
230 void CSSFontSelector::loadPendingFonts() 225 void CSSFontSelector::loadPendingFonts()
231 { 226 {
232 m_fontLoader.loadPendingFonts(); 227 m_fontLoader.loadPendingFonts();
233 } 228 }
234 229
235 } 230 }
OLDNEW
« no previous file with comments | « Source/core/css/CSSFontSelector.h ('k') | Source/core/css/CSSSegmentedFontFaceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698