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

Unified Diff: third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.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/AcceleratedStaticBitmapImage.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
index 0ec750ec1b6c1019be6bd2499f8338e5872d67da..c572b79a3a5b4552538ef754a612b11024fea9a7 100644
--- a/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
+++ b/third_party/WebKit/Source/platform/graphics/AcceleratedStaticBitmapImage.cpp
@@ -20,23 +20,23 @@
namespace blink {
-PassRefPtr<AcceleratedStaticBitmapImage> AcceleratedStaticBitmapImage::create(PassRefPtr<SkImage> image)
+PassRefPtr<AcceleratedStaticBitmapImage> AcceleratedStaticBitmapImage::create(sk_sp<SkImage> image)
{
- return adoptRef(new AcceleratedStaticBitmapImage(image));
+ return adoptRef(new AcceleratedStaticBitmapImage(std::move(image)));
}
-PassRefPtr<AcceleratedStaticBitmapImage> AcceleratedStaticBitmapImage::create(PassRefPtr<SkImage> image, sk_sp<GrContext> grContext, const gpu::Mailbox& mailbox, const gpu::SyncToken& syncToken)
+PassRefPtr<AcceleratedStaticBitmapImage> AcceleratedStaticBitmapImage::create(sk_sp<SkImage> image, sk_sp<GrContext> grContext, const gpu::Mailbox& mailbox, const gpu::SyncToken& syncToken)
{
- return adoptRef(new AcceleratedStaticBitmapImage(image, std::move(grContext), mailbox, syncToken));
+ return adoptRef(new AcceleratedStaticBitmapImage(std::move(image), std::move(grContext), mailbox, syncToken));
}
-AcceleratedStaticBitmapImage::AcceleratedStaticBitmapImage(PassRefPtr<SkImage> image)
+AcceleratedStaticBitmapImage::AcceleratedStaticBitmapImage(sk_sp<SkImage> image)
: StaticBitmapImage(std::move(image))
, m_imageIsForSharedMainThreadContext(true)
{
}
-AcceleratedStaticBitmapImage::AcceleratedStaticBitmapImage(PassRefPtr<SkImage> image, sk_sp<GrContext> grContext, const gpu::Mailbox& mailbox, const gpu::SyncToken& syncToken)
+AcceleratedStaticBitmapImage::AcceleratedStaticBitmapImage(sk_sp<SkImage> image, sk_sp<GrContext> grContext, const gpu::Mailbox& mailbox, const gpu::SyncToken& syncToken)
: StaticBitmapImage(std::move(image))
, m_imageIsForSharedMainThreadContext(false) // TODO(danakj): Could be true though, caller would know.
, m_grContext(std::move(grContext))
@@ -64,7 +64,7 @@ void AcceleratedStaticBitmapImage::copyToTexture(WebGraphicsContext3DProvider* d
destGL->DeleteTextures(1, &sourceTextureId);
}
-PassRefPtr<SkImage> AcceleratedStaticBitmapImage::imageForCurrentFrame()
+sk_sp<SkImage> AcceleratedStaticBitmapImage::imageForCurrentFrame()
{
// This must return an SkImage that can be used with the shared main thread context. If |m_image| satisfies that, we are done.
if (m_imageIsForSharedMainThreadContext)
@@ -96,7 +96,7 @@ PassRefPtr<SkImage> AcceleratedStaticBitmapImage::imageForCurrentFrame()
backendTexture.fConfig = kSkia8888_GrPixelConfig;
backendTexture.fTextureHandle = skia::GrGLTextureInfoToGrBackendObject(textureInfo);
- m_image = fromSkSp(SkImage::MakeFromAdoptedTexture(sharedGrContext, backendTexture));
+ m_image = SkImage::MakeFromAdoptedTexture(sharedGrContext, backendTexture);
m_imageIsForSharedMainThreadContext = true;
// Can drop the ref on the GrContext since m_image is now backed by a texture from the shared main thread context.
m_grContext = nullptr;

Powered by Google App Engine
This is Rietveld 408576698