| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 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 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 #endif | 139 #endif |
| 140 | 140 |
| 141 static FontDataCache* gFontDataCache = 0; | 141 static FontDataCache* gFontDataCache = 0; |
| 142 | 142 |
| 143 PassRefPtr<SimpleFontData> FontCache::getFontData(const FontDescription& fontDes
cription, const AtomicString& family, bool checkingAlternateName, ShouldRetain s
houldRetain) | 143 PassRefPtr<SimpleFontData> FontCache::getFontData(const FontDescription& fontDes
cription, const AtomicString& family, bool checkingAlternateName, ShouldRetain s
houldRetain) |
| 144 { | 144 { |
| 145 if (FontPlatformData* platformData = getFontPlatformData(fontDescription, ad
justFamilyNameToAvoidUnsupportedFonts(family), checkingAlternateName)) | 145 if (FontPlatformData* platformData = getFontPlatformData(fontDescription, ad
justFamilyNameToAvoidUnsupportedFonts(family), checkingAlternateName)) |
| 146 return fontDataFromFontPlatformData(platformData, shouldRetain); | 146 return fontDataFromFontPlatformData(platformData, shouldRetain); |
| 147 | 147 |
| 148 return 0; | 148 return nullptr; |
| 149 } | 149 } |
| 150 | 150 |
| 151 PassRefPtr<SimpleFontData> FontCache::fontDataFromFontPlatformData(const FontPla
tformData* platformData, ShouldRetain shouldRetain) | 151 PassRefPtr<SimpleFontData> FontCache::fontDataFromFontPlatformData(const FontPla
tformData* platformData, ShouldRetain shouldRetain) |
| 152 { | 152 { |
| 153 if (!gFontDataCache) | 153 if (!gFontDataCache) |
| 154 gFontDataCache = new FontDataCache; | 154 gFontDataCache = new FontDataCache; |
| 155 | 155 |
| 156 #if !ASSERT_DISABLED | 156 #if !ASSERT_DISABLED |
| 157 if (shouldRetain == DoNotRetain) | 157 if (shouldRetain == DoNotRetain) |
| 158 ASSERT(m_purgePreventCount); | 158 ASSERT(m_purgePreventCount); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 clients.append(*it); | 285 clients.append(*it); |
| 286 | 286 |
| 287 ASSERT(numClients == clients.size()); | 287 ASSERT(numClients == clients.size()); |
| 288 for (size_t i = 0; i < numClients; ++i) | 288 for (size_t i = 0; i < numClients; ++i) |
| 289 clients[i]->fontCacheInvalidated(); | 289 clients[i]->fontCacheInvalidated(); |
| 290 | 290 |
| 291 purge(ForcePurge); | 291 purge(ForcePurge); |
| 292 } | 292 } |
| 293 | 293 |
| 294 } // namespace WebCore | 294 } // namespace WebCore |
| OLD | NEW |