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

Unified Diff: third_party/WebKit/Source/platform/DragImage.cpp

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Self-review. Created 4 years, 4 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..bd89c79493cfcaf4eca0dced2411b9c735765c85 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());
@@ -110,7 +110,7 @@ PassRefPtr<SkImage> DragImage::resizeAndOrientImage(PassRefPtr<SkImage> image, I
canvas->concat(affineTransformToSkMatrix(transform));
canvas->drawImage(image.get(), 0, 0, &paint);
f(malita) 2016/09/01 03:55:38 Ditto.
Łukasz Anforowicz 2016/09/01 20:50:57 Done.
- 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;

Powered by Google App Engine
This is Rietveld 408576698