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

Unified Diff: third_party/WebKit/Source/platform/graphics/PictureSnapshot.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/graphics/PictureSnapshot.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
index c9fa7320db496293edb802643f51e506da718de3..46b50d98fd1b63b5eb001ed12f962d9784d0e344 100644
--- a/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
+++ b/third_party/WebKit/Source/platform/graphics/PictureSnapshot.cpp
@@ -53,8 +53,8 @@
namespace blink {
-PictureSnapshot::PictureSnapshot(PassRefPtr<const SkPicture> picture)
- : m_picture(picture)
+PictureSnapshot::PictureSnapshot(sk_sp<const SkPicture> picture)
+ : m_picture(std::move(picture))
{
}
@@ -91,7 +91,7 @@ PassRefPtr<PictureSnapshot> PictureSnapshot::load(const Vector<RefPtr<TilePictur
pictures.append(std::move(picture));
}
if (tiles.size() == 1)
- return adoptRef(new PictureSnapshot(fromSkSp(std::move(pictures[0]))));
+ return adoptRef(new PictureSnapshot(std::move(pictures[0])));
SkPictureRecorder recorder;
SkCanvas* canvas = recorder.beginRecording(unionRect.width(), unionRect.height(), 0, 0);
for (size_t i = 0; i < pictures.size(); ++i) {
@@ -100,7 +100,7 @@ PassRefPtr<PictureSnapshot> PictureSnapshot::load(const Vector<RefPtr<TilePictur
pictures[i]->playback(canvas, 0);
canvas->restore();
}
- return adoptRef(new PictureSnapshot(fromSkSp(recorder.finishRecordingAsPicture())));
+ return adoptRef(new PictureSnapshot(recorder.finishRecordingAsPicture()));
}
bool PictureSnapshot::isEmpty() const
@@ -131,7 +131,7 @@ std::unique_ptr<Vector<char>> PictureSnapshot::replay(unsigned fromStep, unsigne
std::unique_ptr<Vector<char>> base64Data = wrapUnique(new Vector<char>());
Vector<char> encodedImage;
- RefPtr<SkImage> image = fromSkSp(SkImage::MakeFromBitmap(bitmap));
+ sk_sp<SkImage> image = SkImage::MakeFromBitmap(bitmap);
if (!image)
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698