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

Unified Diff: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
index ab20956ae401ded2906099e7c8766f55aab9296f..d354cd12a75dbbbb4bc56ae1c9be6afc73679d6f 100644
--- a/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
+++ b/third_party/WebKit/Source/platform/fonts/win/FontCacheSkiaWin.cpp
@@ -45,7 +45,7 @@
namespace blink {
-HashMap<String, RefPtr<SkTypeface>>* FontCache::s_sideloadedFonts = 0;
+HashMap<String, sk_sp<SkTypeface>>* FontCache::s_sideloadedFonts = 0;
// Cached system font metrics.
AtomicString* FontCache::s_menuFontFamilyName = 0;
@@ -70,10 +70,10 @@ int32_t ensureMinimumFontHeightIfNeeded(int32_t fontHeight)
void FontCache::addSideloadedFontForTesting(SkTypeface* typeface)
{
if (!s_sideloadedFonts)
- s_sideloadedFonts = new HashMap<String, RefPtr<SkTypeface>>;
+ s_sideloadedFonts = new HashMap<String, sk_sp<SkTypeface>>;
SkString name;
typeface->getFamilyName(&name);
- s_sideloadedFonts->set(name.c_str(), adoptRef(typeface));
+ s_sideloadedFonts->set(name.c_str(), sk_sp<SkTypeface>(typeface));
}
// static
@@ -100,9 +100,9 @@ void FontCache::setStatusFontMetrics(const wchar_t* familyName, int32_t fontHeig
FontCache::FontCache()
: m_purgePreventCount(0)
{
- m_fontManager = s_staticFontManager;
- if (!m_fontManager.get())
- m_fontManager = adoptRef(SkFontMgr_New_DirectWrite());
+ m_fontManager = sk_ref_sp(s_staticFontManager);
+ if (!m_fontManager)
+ m_fontManager.reset(SkFontMgr_New_DirectWrite());
ASSERT(m_fontManager.get());
}
@@ -360,7 +360,7 @@ std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDe
ASSERT(creationParams.creationType() == CreateFontByFamily);
CString name;
- RefPtr<SkTypeface> tf = createTypeface(fontDescription, creationParams, name);
+ sk_sp<SkTypeface> tf = createTypeface(fontDescription, creationParams, name);
// Windows will always give us a valid pointer here, even if the face name
// is non-existent. We have to double-check and see if the family name was
// really used.

Powered by Google App Engine
This is Rietveld 408576698