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

Unified Diff: third_party/WebKit/Source/platform/fonts/WebFontDecoder.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/WebFontDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
index ff9ce7c2f3cf223c48a6c656d8f365f26496a3f3..3723461213d12835f291a3171a9fdf7f160a5bb9 100644
--- a/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
+++ b/third_party/WebKit/Source/platform/fonts/WebFontDecoder.cpp
@@ -153,7 +153,7 @@ bool WebFontDecoder::supportsFormat(const String& format)
return equalIgnoringCase(format, "woff") || equalIgnoringCase(format, "woff2");
}
-PassRefPtr<SkTypeface> WebFontDecoder::decode(SharedBuffer* buffer)
+sk_sp<SkTypeface> WebFontDecoder::decode(SharedBuffer* buffer)
{
if (!buffer) {
setErrorString("Empty Buffer");
@@ -190,16 +190,16 @@ PassRefPtr<SkTypeface> WebFontDecoder::decode(SharedBuffer* buffer)
sk_sp<SkData> skData = SkData::MakeWithCopy(output.get(), decodedLength);
SkMemoryStream* stream = new SkMemoryStream(skData);
#if OS(WIN)
- RefPtr<SkTypeface> typeface = adoptRef(FontCache::fontCache()->fontManager()->createFromStream(stream));
+ sk_sp<SkTypeface> typeface(FontCache::fontCache()->fontManager()->createFromStream(stream));
#else
- RefPtr<SkTypeface> typeface = fromSkSp(SkTypeface::MakeFromStream(stream));
+ sk_sp<SkTypeface> typeface = SkTypeface::MakeFromStream(stream);
#endif
if (!typeface) {
setErrorString("Not a valid font data");
return nullptr;
}
- return typeface.release();
+ return typeface;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698