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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 2300633004: Allow canvases to be GPU-accelerated in Workers (Closed)
Patch Set: 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/graphics/gpu/DrawingBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
index b2c395f6d3d97a31fead115ea742925035837f99..d09b1226d10022808bd7f51bcee838befd18aee0 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -459,8 +459,6 @@ PassRefPtr<StaticBitmapImage> DrawingBuffer::transferToStaticBitmapImage()
backendTexture.fTextureHandle = skia::GrGLTextureInfoToGrBackendObject(textureInfo);
sk_sp<SkImage> skImage = SkImage::MakeFromAdoptedTexture(grContext, backendTexture);
- // Hold a ref on the GrContext for the texture backing the |skImage|.
- sk_sp<GrContext> grContextRef = sk_ref_sp(grContext);
// We reuse the same mailbox name from above since our texture id was consumed from it.
const auto& skImageMailbox = textureMailbox.mailbox();
// Use the sync token generated after producing the mailbox. Waiting for this before trying to use
@@ -471,7 +469,7 @@ PassRefPtr<StaticBitmapImage> DrawingBuffer::transferToStaticBitmapImage()
// TODO(xidachen): Create a small pool of recycled textures from ImageBitmapRenderingContext's
// transferFromImageBitmap, and try to use them in DrawingBuffer.
- return AcceleratedStaticBitmapImage::create(fromSkSp(skImage), grContextRef, skImageMailbox, skImageSyncToken);
+ return AcceleratedStaticBitmapImage::create(fromSkSp(skImage), grContext, skImageMailbox, skImageSyncToken);
}
DrawingBuffer::TextureParameters DrawingBuffer::chromiumImageTextureParameters()

Powered by Google App Engine
This is Rietveld 408576698