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() |