| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 | 267 |
| 268 PassRefPtr<SimpleFontData> FontCache::getFontData( | 268 PassRefPtr<SimpleFontData> FontCache::getFontData( |
| 269 const FontDescription& fontDescription, | 269 const FontDescription& fontDescription, |
| 270 const AtomicString& family, | 270 const AtomicString& family, |
| 271 AlternateFontName alternameFontName, | 271 AlternateFontName alternameFontName, |
| 272 ShouldRetain shouldRetain) { | 272 ShouldRetain shouldRetain) { |
| 273 if (FontPlatformData* platformData = getFontPlatformData( | 273 if (FontPlatformData* platformData = getFontPlatformData( |
| 274 fontDescription, FontFaceCreationParams( | 274 fontDescription, FontFaceCreationParams( |
| 275 adjustFamilyNameToAvoidUnsupportedFonts(family)), | 275 adjustFamilyNameToAvoidUnsupportedFonts(family)), |
| 276 alternameFontName)) { | 276 alternameFontName)) { |
| 277 return fontDataFromFontPlatformData( | 277 return fontDataFromFontPlatformData(platformData, shouldRetain); |
| 278 platformData, shouldRetain, fontDescription.subpixelAscentDescent()); | |
| 279 } | 278 } |
| 280 | 279 |
| 281 return nullptr; | 280 return nullptr; |
| 282 } | 281 } |
| 283 | 282 |
| 284 PassRefPtr<SimpleFontData> FontCache::fontDataFromFontPlatformData( | 283 PassRefPtr<SimpleFontData> FontCache::fontDataFromFontPlatformData( |
| 285 const FontPlatformData* platformData, | 284 const FontPlatformData* platformData, |
| 286 ShouldRetain shouldRetain, | 285 ShouldRetain shouldRetain) { |
| 287 bool subpixelAscentDescent) { | |
| 288 if (!gFontDataCache) | 286 if (!gFontDataCache) |
| 289 gFontDataCache = new FontDataCache; | 287 gFontDataCache = new FontDataCache; |
| 290 | 288 |
| 291 #if DCHECK_IS_ON() | 289 #if DCHECK_IS_ON() |
| 292 if (shouldRetain == DoNotRetain) | 290 if (shouldRetain == DoNotRetain) |
| 293 ASSERT(m_purgePreventCount); | 291 ASSERT(m_purgePreventCount); |
| 294 #endif | 292 #endif |
| 295 | 293 |
| 296 return gFontDataCache->get(platformData, shouldRetain, subpixelAscentDescent); | 294 return gFontDataCache->get(platformData, shouldRetain); |
| 297 } | 295 } |
| 298 | 296 |
| 299 bool FontCache::isPlatformFamilyMatchAvailable( | 297 bool FontCache::isPlatformFamilyMatchAvailable( |
| 300 const FontDescription& fontDescription, | 298 const FontDescription& fontDescription, |
| 301 const AtomicString& family) { | 299 const AtomicString& family) { |
| 302 return getFontPlatformData( | 300 return getFontPlatformData( |
| 303 fontDescription, | 301 fontDescription, |
| 304 FontFaceCreationParams(adjustFamilyNameToAvoidUnsupportedFonts(family)), | 302 FontFaceCreationParams(adjustFamilyNameToAvoidUnsupportedFonts(family)), |
| 305 AlternateFontName::NoAlternate); | 303 AlternateFontName::NoAlternate); |
| 306 } | 304 } |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 for (iter = gFallbackListShaperCache->begin(); | 503 for (iter = gFallbackListShaperCache->begin(); |
| 506 iter != gFallbackListShaperCache->end(); ++iter) { | 504 iter != gFallbackListShaperCache->end(); ++iter) { |
| 507 shapeResultCacheSize += iter->value->byteSize(); | 505 shapeResultCacheSize += iter->value->byteSize(); |
| 508 } | 506 } |
| 509 dump->AddScalar("size", "bytes", shapeResultCacheSize); | 507 dump->AddScalar("size", "bytes", shapeResultCacheSize); |
| 510 memoryDump->AddSuballocation(dump->guid(), | 508 memoryDump->AddSuballocation(dump->guid(), |
| 511 WTF::Partitions::kAllocatedObjectPoolName); | 509 WTF::Partitions::kAllocatedObjectPoolName); |
| 512 } | 510 } |
| 513 | 511 |
| 514 } // namespace blink | 512 } // namespace blink |
| OLD | NEW |