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

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: 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 ceb485bdbf6c7e4ddd84cb242e0e556ae3c88ebf..e86e22bac5a50c567cb9a6d4e84a66bdd05a5aa1 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -633,6 +633,14 @@ void WebGLRenderingContextBase::forceNextWebGLContextCreationToFail()
shouldFailContextCreationForTesting = true;
}
+ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase()
+{
+ ImageData* imageData = paintRenderingResultsToImageData(BackBuffer);
Ken Russell (switch to Gerrit) 2016/05/10 23:11:42 This needs to be much better optimized in the futu
xidachen 2016/05/11 00:17:52 In the case of 2d canvas context, it contains a Im
+ if (!imageData)
+ return nullptr;
+ return ImageBitmap::create(imageData, IntRect(0, 0, imageData->width(), imageData->height()));
+}
+
namespace {
// ES2 enums
@@ -1164,6 +1172,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