| 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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 } | 178 } |
| 179 | 179 |
| 180 typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, IntHash<Fo
ntCache::FontFileKey>, UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey>> Fo
ntVerticalDataCache; | 180 typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, IntHash<Fo
ntCache::FontFileKey>, UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey>> Fo
ntVerticalDataCache; |
| 181 | 181 |
| 182 FontVerticalDataCache& fontVerticalDataCacheInstance() | 182 FontVerticalDataCache& fontVerticalDataCacheInstance() |
| 183 { | 183 { |
| 184 DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ()); | 184 DEFINE_STATIC_LOCAL(FontVerticalDataCache, fontVerticalDataCache, ()); |
| 185 return fontVerticalDataCache; | 185 return fontVerticalDataCache; |
| 186 } | 186 } |
| 187 | 187 |
| 188 void FontCache::setFontManager(const RefPtr<SkFontMgr>& fontManager) | 188 void FontCache::setFontManager(const sk_sp<SkFontMgr>& fontManager) |
| 189 { | 189 { |
| 190 DCHECK(!s_staticFontManager); | 190 DCHECK(!s_staticFontManager); |
| 191 s_staticFontManager = fontManager.get(); | 191 s_staticFontManager = fontManager.get(); |
| 192 // Explicitly AddRef since we're going to hold on to the object for the life
of the program. | 192 // Explicitly AddRef since we're going to hold on to the object for the life
of the program. |
| 193 s_staticFontManager->ref(); | 193 s_staticFontManager->ref(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& k
ey, const FontPlatformData& platformData) | 196 PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& k
ey, const FontPlatformData& platformData) |
| 197 { | 197 { |
| 198 FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance
(); | 198 FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance
(); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 for (iter = gFallbackListShaperCache->begin(); | 405 for (iter = gFallbackListShaperCache->begin(); |
| 406 iter != gFallbackListShaperCache->end(); | 406 iter != gFallbackListShaperCache->end(); |
| 407 ++iter) { | 407 ++iter) { |
| 408 shapeResultCacheSize += iter->value->byteSize(); | 408 shapeResultCacheSize += iter->value->byteSize(); |
| 409 } | 409 } |
| 410 dump->AddScalar("size", "bytes", shapeResultCacheSize); | 410 dump->AddScalar("size", "bytes", shapeResultCacheSize); |
| 411 memoryDump->AddSuballocation(dump->guid(), WTF::Partitions::kAllocatedObject
PoolName); | 411 memoryDump->AddSuballocation(dump->guid(), WTF::Partitions::kAllocatedObject
PoolName); |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace blink | 414 } // namespace blink |
| OLD | NEW |