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

Unified Diff: third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.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/modules/imagebitmap/ImageBitmapRenderingContext.cpp
diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
index 7f7c5744c6ecfc23c242710a9b8c4a64d3b44452..d66e77c8ddcc58558b7d9a23acd2bd3b38ffa8c9 100644
--- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
+++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
@@ -35,7 +35,7 @@ void ImageBitmapRenderingContext::transferFromImageBitmap(ImageBitmap* imageBitm
if (!m_image)
return;
- RefPtr<SkImage> skImage = m_image->imageForCurrentFrame();
+ sk_sp<SkImage> skImage = m_image->imageForCurrentFrame();
if (skImage->isTextureBacked()) {
// TODO(junov): crbug.com/585607 Eliminate this readback and use an ExternalTextureLayer
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(skImage->width(), skImage->height());
@@ -45,7 +45,7 @@ void ImageBitmapRenderingContext::transferFromImageBitmap(ImageBitmap* imageBitm
return;
}
surface->getCanvas()->drawImage(skImage.get(), 0, 0);
f(malita) 2016/09/01 03:55:37 Nit: drop the .get(). it's cleaner.
Łukasz Anforowicz 2016/09/01 20:50:57 Done.
- m_image = StaticBitmapImage::create(fromSkSp(surface->makeImageSnapshot()));
+ m_image = StaticBitmapImage::create(surface->makeImageSnapshot());
}
canvas()->didDraw(FloatRect(FloatPoint(), FloatSize(m_image->width(), m_image->height())));
}

Powered by Google App Engine
This is Rietveld 408576698