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

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

Issue 2323573002: Revert of Allow canvases to be GPU-accelerated in Workers (Closed)
Patch Set: 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/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 a003681da3ee3356c7cb7077fa284e2045ac8ebf..296bf56de55d410e15cdfd99629e34b80dfe989d 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -459,6 +459,8 @@
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
@@ -469,7 +471,7 @@
// TODO(xidachen): Create a small pool of recycled textures from ImageBitmapRenderingContext's
// transferFromImageBitmap, and try to use them in DrawingBuffer.
- return AcceleratedStaticBitmapImage::createFromWebGLContextImage(std::move(skImage), skImageMailbox, skImageSyncToken);
+ return AcceleratedStaticBitmapImage::create(std::move(skImage), grContextRef, skImageMailbox, skImageSyncToken);
}
DrawingBuffer::TextureParameters DrawingBuffer::chromiumImageTextureParameters()

Powered by Google App Engine
This is Rietveld 408576698