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

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

Issue 1962413002: Implement transferToImageBitmap() in WebGLRenderingContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add new test case, cache SkIMage Created 4 years, 7 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 4f64e965baee7d050d1238d96baa164b5d28447a..1d919f2e387d265dd450c150e528b2d3bd3634b5 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -634,6 +634,18 @@ void WebGLRenderingContextBase::forceNextWebGLContextCreationToFail()
shouldFailContextCreationForTesting = true;
}
+ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase()
+{
+ if (!drawingBuffer())
+ return nullptr;
+ WebExternalTextureMailbox mailbox;
+ drawingBuffer()->prepareMailbox(&mailbox, 0);
+ ImageBitmap* 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;
+}
+
namespace {
// ES2 enums
@@ -1165,6 +1177,9 @@ void WebGLRenderingContextBase::markContextChanged(ContentChangeType changeType)
drawingBuffer()->markContentsChanged();
+ if (!canvas())
+ return;
+
LayoutBox* layoutBox = canvas()->layoutBox();
if (layoutBox && layoutBox->hasAcceleratedCompositing()) {
m_markedCanvasDirty = true;

Powered by Google App Engine
This is Rietveld 408576698