Chromium Code Reviews| Index: content/renderer/renderer_blink_platform_impl.cc |
| diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc |
| index 3d91912d563004b9334418bdb9400f8a6b6b2ad5..e22176578129b905f6e4f4168cc6fa8585db40ce 100644 |
| --- a/content/renderer/renderer_blink_platform_impl.cc |
| +++ b/content/renderer/renderer_blink_platform_impl.cc |
| @@ -1020,17 +1020,29 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider( |
| // This is an offscreen context, which doesn't use the default frame buffer, |
| // so don't request any alpha, depth, stencil, antialiasing. |
| gpu::gles2::ContextCreationAttribHelper attributes; |
| - attributes.alpha_size = -1; |
| - attributes.depth_size = 0; |
| - attributes.stencil_size = 0; |
| - attributes.samples = 0; |
| - attributes.sample_buffers = 0; |
| + |
| + if (web_attributes.supportOwnOffscreenSurface) { |
| + attributes.own_offscreen_surface = true; |
| + attributes.low_priority = true; |
| + attributes.alpha_size = web_attributes.supportAlpha ? 8 : -1; |
| + attributes.depth_size = web_attributes.supportDepth ? 24 : 0; |
| + attributes.stencil_size = web_attributes.supportStencil ? 8 : 0; |
| + attributes.samples = web_attributes.supportAntialias ? 4 : 0; |
| + attributes.sample_buffers = 0; |
| + } else { |
| + attributes.alpha_size = -1; |
|
dcheng
2017/01/09 23:14:57
Nit: I think this is the default value already (ht
klausw
2017/01/09 23:33:24
This matches the pre-patch logic, and in this case
|
| + attributes.depth_size = 0; |
| + attributes.stencil_size = 0; |
| + attributes.samples = 0; |
| + attributes.sample_buffers = 0; |
| + } |
| attributes.bind_generates_resource = false; |
| // Prefer discrete GPU for WebGL. |
| attributes.gpu_preference = gl::PreferDiscreteGpu; |
| attributes.fail_if_major_perf_caveat = |
| web_attributes.failIfMajorPerformanceCaveat; |
| + |
| DCHECK_GT(web_attributes.webGLVersion, 0u); |
| DCHECK_LE(web_attributes.webGLVersion, 2u); |
| if (web_attributes.webGLVersion == 2) |