Chromium Code Reviews| 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; |