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..47e96325c52731497901e656d540dff5ef0ba307 100644 |
| --- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| +++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp |
| @@ -633,6 +633,22 @@ void WebGLRenderingContextBase::forceNextWebGLContextCreationToFail() |
| shouldFailContextCreationForTesting = true; |
| } |
| +ImageBitmap* WebGLRenderingContextBase::transferToImageBitmapBase() |
| +{ |
| + if (!drawingBuffer()) |
| + return nullptr; |
| + GrContext* grContext = drawingBuffer()->contextProvider()->grContext(); |
| + if (!grContext) |
| + return nullptr; |
| + SkAlphaType alphaType = (m_requestedAttributes.premultipliedAlpha()) ? kPremul_SkAlphaType : kOpaque_SkAlphaType; |
| + SkImageInfo info = SkImageInfo::MakeN32(drawingBufferWidth(), drawingBufferHeight(), alphaType); |
| + SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); |
| + sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(grContext, SkBudgeted::kNo, info, 0, (m_requestedAttributes.premultipliedAlpha()) ? &disableLCDProps : nullptr); |
|
xidachen
2016/05/13 18:56:08
junov@: could you take a look? I am not sure what
Ken Russell (switch to Gerrit)
2016/05/13 20:08:30
The code above is referencing the Ganesh context f
Justin Novosad
2016/05/13 20:36:27
I agree with what Ken wrote. Sorry for the bad pa
|
| + RefPtr<StaticBitmapImage> image = StaticBitmapImage::create(surface->makeImageSnapshot(SkBudgeted::kNo).release()); |
| + ImageBitmap* imageBitmap = ImageBitmap::create(image.release()); |
| + return imageBitmap; |
| +} |
| + |
| namespace { |
| // ES2 enums |
| @@ -1164,6 +1180,9 @@ void WebGLRenderingContextBase::markContextChanged(ContentChangeType changeType) |
| drawingBuffer()->markContentsChanged(); |
| + if (!canvas()) |
| + return; |
| + |
| LayoutBox* layoutBox = canvas()->layoutBox(); |
| if (layoutBox && layoutBox->hasAcceleratedCompositing()) { |
| m_markedCanvasDirty = true; |