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

Unified Diff: third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.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/FontCustomPlatformData.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
index c38d495fb0f6809f566002237f28cbc670b137f4..f2b35e6fb1d8eb0bdb60f063097fdfdaaa98912b 100644
--- a/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/FontCustomPlatformData.cpp
@@ -44,7 +44,7 @@
namespace blink {
-FontCustomPlatformData::FontCustomPlatformData(PassRefPtr<SkTypeface> typeface)
+FontCustomPlatformData::FontCustomPlatformData(sk_sp<SkTypeface> typeface)
: m_typeface(typeface) { }
FontCustomPlatformData::~FontCustomPlatformData()
@@ -54,19 +54,19 @@ FontCustomPlatformData::~FontCustomPlatformData()
FontPlatformData FontCustomPlatformData::fontPlatformData(float size, bool bold, bool italic, FontOrientation orientation)
{
ASSERT(m_typeface);
- return FontPlatformData(m_typeface.get(), "", size, bold && !m_typeface->isBold(), italic && !m_typeface->isItalic(), orientation);
+ return FontPlatformData(m_typeface, "", size, bold && !m_typeface->isBold(), italic && !m_typeface->isItalic(), orientation);
}
std::unique_ptr<FontCustomPlatformData> FontCustomPlatformData::create(SharedBuffer* buffer, String& otsParseMessage)
{
DCHECK(buffer);
WebFontDecoder decoder;
- RefPtr<SkTypeface> typeface = decoder.decode(buffer);
+ sk_sp<SkTypeface> typeface = decoder.decode(buffer);
if (!typeface) {
otsParseMessage = decoder.getErrorString();
return nullptr;
}
- return wrapUnique(new FontCustomPlatformData(typeface.release()));
+ return wrapUnique(new FontCustomPlatformData(std::move(typeface)));
}
bool FontCustomPlatformData::supportsFormat(const String& format)

Powered by Google App Engine
This is Rietveld 408576698