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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.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/Font.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index 404b2b287ef9a841386e083126f22d8365d7b2ee..74b379a6b8a8358497ea29e3f8aaf880292464b2 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -266,7 +266,7 @@ public:
bool done() const { return m_index >= m_buffer.size(); }
unsigned blobCount() const { return m_blobCount; }
- std::pair<RefPtr<const SkTextBlob>, BlobRotation> next()
+ std::pair<sk_sp<const SkTextBlob>, BlobRotation> next()
{
ASSERT(!done());
const BlobRotation currentRotation = m_rotation;
@@ -291,7 +291,7 @@ public:
}
m_blobCount++;
- return std::make_pair(adoptRef(m_builder.build()), currentRotation);
+ return std::make_pair(sk_sp<const SkTextBlob>(m_builder.build()), currentRotation);
}
private:
@@ -350,7 +350,7 @@ void Font::drawGlyphBuffer(SkCanvas* canvas, const SkPaint& paint, const TextRun
const GlyphBuffer& glyphBuffer, const FloatPoint& point, float deviceScaleFactor) const
{
GlyphBufferBloberizer bloberizer(glyphBuffer, this, deviceScaleFactor);
- std::pair<RefPtr<const SkTextBlob>, BlobRotation> blob;
+ std::pair<sk_sp<const SkTextBlob>, BlobRotation> blob;
while (!bloberizer.done()) {
blob = bloberizer.next();
@@ -374,7 +374,7 @@ void Font::drawGlyphBuffer(SkCanvas* canvas, const SkPaint& paint, const TextRun
// 3) the blob is not upright/rotated
if (runInfo.cachedTextBlob && bloberizer.blobCount() == 1 && blob.second == NoRotation) {
ASSERT(!*runInfo.cachedTextBlob);
- *runInfo.cachedTextBlob = blob.first.release();
+ *runInfo.cachedTextBlob = std::move(blob.first);
ASSERT(*runInfo.cachedTextBlob);
}
}
« no previous file with comments | « third_party/WebKit/Source/platform/exported/WebImage.cpp ('k') | third_party/WebKit/Source/platform/fonts/FontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698