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

Unified Diff: third_party/WebKit/Source/platform/DragImage.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/DragImage.cpp
diff --git a/third_party/WebKit/Source/platform/DragImage.cpp b/third_party/WebKit/Source/platform/DragImage.cpp
index e1b11d007220e00f0f9f89299123c774ea2a4e9b..93726fe852eba917efa24cb21e3bbd3e42fb69cb 100644
--- a/third_party/WebKit/Source/platform/DragImage.cpp
+++ b/third_party/WebKit/Source/platform/DragImage.cpp
@@ -73,7 +73,7 @@ const float kDragLinkUrlFontSize = 10;
} // anonymous namespace
-PassRefPtr<SkImage> DragImage::resizeAndOrientImage(PassRefPtr<SkImage> image, ImageOrientation orientation,
+sk_sp<SkImage> DragImage::resizeAndOrientImage(sk_sp<SkImage> image, ImageOrientation orientation,
FloatSize imageScale, float opacity, InterpolationQuality interpolationQuality)
{
IntSize size(image->width(), image->height());
@@ -108,9 +108,9 @@ PassRefPtr<SkImage> DragImage::resizeAndOrientImage(PassRefPtr<SkImage> image, I
SkCanvas* canvas = surface->getCanvas();
canvas->concat(affineTransformToSkMatrix(transform));
- canvas->drawImage(image.get(), 0, 0, &paint);
+ canvas->drawImage(image, 0, 0, &paint);
- return fromSkSp(surface->makeImageSnapshot());
+ return surface->makeImageSnapshot();
}
FloatSize DragImage::clampedImageScale(const IntSize& imageSize, const IntSize& size,
@@ -138,7 +138,7 @@ std::unique_ptr<DragImage> DragImage::create(Image* image,
if (!image)
return nullptr;
- RefPtr<SkImage> skImage = image->imageForCurrentFrame();
+ sk_sp<SkImage> skImage = image->imageForCurrentFrame();
if (!skImage)
return nullptr;
@@ -147,8 +147,8 @@ std::unique_ptr<DragImage> DragImage::create(Image* image,
orientation = toBitmapImage(image)->currentFrameOrientation();
SkBitmap bm;
- RefPtr<SkImage> resizedImage =
- resizeAndOrientImage(skImage.release(), orientation, imageScale, opacity, interpolationQuality);
+ sk_sp<SkImage> resizedImage =
+ resizeAndOrientImage(std::move(skImage), orientation, imageScale, opacity, interpolationQuality);
if (!resizedImage || !resizedImage->asLegacyBitmap(&bm, SkImage::kRO_LegacyBitmapMode))
return nullptr;
« no previous file with comments | « third_party/WebKit/Source/platform/DragImage.h ('k') | third_party/WebKit/Source/platform/DragImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698