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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2261623002: Make DrawingBuffer and Canvas2DLayerBridge be cc::TextureLayerClients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webmailbox: fix-passrefptr 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/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 5fbbbae804cc29c5758b026e8aa9762a0231e295..a376b6c1e45025880a6e39a082736ecacc529a4a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -646,20 +646,7 @@ ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase()
{
if (!drawingBuffer())
return nullptr;
- WebExternalTextureMailbox mailbox;
- drawingBuffer()->prepareMailbox(&mailbox, 0);
- ImageBitmap* imageBitmap;
- // If the mailbox is invalid, return an transparent black ImageBitmap.
- // The only situation this could happen is when two or more calls to transferToImageBitmap are made back-to-back.
- if (mailbox.textureSize.width == 0 && mailbox.textureSize.height == 0) {
- sk_sp<SkSurface>surface = SkSurface::MakeRasterN32Premul(drawingBuffer()->size().width(), drawingBuffer()->size().height());
- imageBitmap = ImageBitmap::create(StaticBitmapImage::create(fromSkSp(surface->makeImageSnapshot())));
- } else {
- imageBitmap = ImageBitmap::create(mailbox);
- }
- // TODO(xidachen): Create a small pool of recycled textures from ImageBitmapRenderingContext's
- // transferFromImageBitmap, and try to use them in DrawingBuffer.
- return imageBitmap;
+ return ImageBitmap::create(drawingBuffer()->transferToStaticBitmapImage());
}
namespace {

Powered by Google App Engine
This is Rietveld 408576698