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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontCache.cpp

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Rebasing... Created 4 years, 3 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698