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

Unified Diff: third_party/WebKit/Source/platform/fonts/mac/FontPlatformDataMac.mm

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/mac/FontPlatformDataMac.mm
diff --git a/third_party/WebKit/Source/platform/fonts/mac/FontPlatformDataMac.mm b/third_party/WebKit/Source/platform/fonts/mac/FontPlatformDataMac.mm
index cb6f5e3e5672f85fb17e632bf94613ef96e306a1..dcc931e9fd98d0a51c749818b95d7b2fc901acca 100644
--- a/third_party/WebKit/Source/platform/fonts/mac/FontPlatformDataMac.mm
+++ b/third_party/WebKit/Source/platform/fonts/mac/FontPlatformDataMac.mm
@@ -73,7 +73,7 @@ static CTFontDescriptorRef cascadeToLastResortFontDescriptor()
return descriptor;
}
-static PassRefPtr<SkTypeface> loadFromBrowserProcess(NSFont* nsFont, float textSize)
+static sk_sp<SkTypeface> loadFromBrowserProcess(NSFont* nsFont, float textSize)
{
// Send cross-process request to load font.
WebSandboxSupport* sandboxSupport = Platform::current()->sandboxSupport();
@@ -94,7 +94,7 @@ static PassRefPtr<SkTypeface> loadFromBrowserProcess(NSFont* nsFont, float textS
}
RetainPtr<CGFontRef> cgFont(AdoptCF, loadedCgFont);
RetainPtr<CTFontRef> ctFont(AdoptCF, CTFontCreateWithGraphicsFont(cgFont.get(), textSize, 0, cascadeToLastResortFontDescriptor()));
- PassRefPtr<SkTypeface> returnFont = adoptRef(SkCreateTypefaceFromCTFont(ctFont.get(), cgFont.get()));
+ sk_sp<SkTypeface> returnFont(SkCreateTypefaceFromCTFont(ctFont.get(), cgFont.get()));
if (!returnFont.get())
// TODO crbug.com/461279: Make this appear in the inspector console?
@@ -133,7 +133,7 @@ void FontPlatformData::setupPaint(SkPaint* paint, float, const Font* font) const
paint->setEmbeddedBitmapText(false);
const float ts = m_textSize >= 0 ? m_textSize : 12;
paint->setTextSize(SkFloatToScalar(ts));
- paint->setTypeface(toSkSp(m_typeface));
+ paint->setTypeface(m_typeface);
paint->setFakeBoldText(m_syntheticBold);
paint->setTextSkewX(m_syntheticItalic ? -SK_Scalar1 / 4 : 0);
paint->setLCDRenderText(shouldSmoothFonts);
@@ -155,7 +155,7 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, float size, bool syntheticBol
{
DCHECK(nsFont);
if (canLoadInProcess(nsFont)) {
- m_typeface = adoptRef(SkCreateTypefaceFromCTFont(toCTFontRef(nsFont)));
+ m_typeface.reset(SkCreateTypefaceFromCTFont(toCTFontRef(nsFont)));
} else {
// In process loading fails for cases where third party font manager software
// registers fonts in non system locations such as /Library/Fonts

Powered by Google App Engine
This is Rietveld 408576698