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

Unified Diff: third_party/WebKit/Source/core/html/HTMLCanvasElement.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/core/html/HTMLCanvasElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index fcf0725fc59a3347546a6caf6120ce34fe0f3bd0..9ec0e15ee415e2d3c8463837151c3a6201bf026e 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -116,7 +116,7 @@ PassRefPtr<Image> createTransparentImage(const IntSize& size)
{
DCHECK(ImageBuffer::canCreateImageBuffer(size));
sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(size.width(), size.height());
- return StaticBitmapImage::create(fromSkSp(surface->makeImageSnapshot()));
+ return StaticBitmapImage::create(surface->makeImageSnapshot());
}
} // namespace
@@ -454,7 +454,7 @@ void HTMLCanvasElement::notifyListenersCanvasChanged()
RefPtr<Image> sourceImage = getSourceImageForCanvas(&status, PreferNoAcceleration, SnapshotReasonCanvasListenerCapture, FloatSize());
if (status != NormalSourceImageStatus)
return;
- RefPtr<SkImage> image = sourceImage->imageForCurrentFrame();
+ sk_sp<SkImage> image = sourceImage->imageForCurrentFrame();
for (CanvasDrawListener* listener : m_listeners) {
if (listener->needsNewFrame()) {
listener->sendNewFrame(image);
@@ -603,7 +603,7 @@ ImageData* HTMLCanvasElement::toImageData(SourceDrawingBuffer sourceBuffer, Snap
m_context->paintRenderingResultsToCanvas(sourceBuffer);
imageData = ImageData::create(m_size);
- RefPtr<SkImage> snapshot = buffer()->newSkImageSnapshot(PreferNoAcceleration, reason);
+ sk_sp<SkImage> snapshot = buffer()->newSkImageSnapshot(PreferNoAcceleration, reason);
if (snapshot) {
SkImageInfo imageInfo = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, kUnpremul_SkAlphaType);
snapshot->readPixels(imageInfo, imageData->data()->data(), imageInfo.minRowBytes(), 0, 0);
@@ -617,7 +617,7 @@ ImageData* HTMLCanvasElement::toImageData(SourceDrawingBuffer sourceBuffer, Snap
return imageData;
DCHECK(m_context->is2d());
- RefPtr<SkImage> snapshot = buffer()->newSkImageSnapshot(PreferNoAcceleration, reason);
+ sk_sp<SkImage> snapshot = buffer()->newSkImageSnapshot(PreferNoAcceleration, reason);
if (snapshot) {
SkImageInfo imageInfo = SkImageInfo::Make(width(), height(), kRGBA_8888_SkColorType, kUnpremul_SkAlphaType);
snapshot->readPixels(imageInfo, imageData->data()->data(), imageInfo.minRowBytes(), 0, 0);
@@ -1130,7 +1130,7 @@ PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(SourceImageStatus*
m_context->paintRenderingResultsToCanvas(BackBuffer);
}
- RefPtr<SkImage> skImage;
+ sk_sp<SkImage> skImage;
RefPtr<blink::Image> image = renderingContext()->getImage(reason);
if (image)
@@ -1138,7 +1138,7 @@ PassRefPtr<Image> HTMLCanvasElement::getSourceImageForCanvas(SourceImageStatus*
if (skImage) {
*status = NormalSourceImageStatus;
- return StaticBitmapImage::create(skImage.release());
+ return StaticBitmapImage::create(std::move(skImage));
}
*status = InvalidSourceImageStatus;
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrame.cpp ('k') | third_party/WebKit/Source/core/html/canvas/CanvasDrawListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698