| 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 339af699cf3917c0519e1e23228f5ab38b7ae9fb..7adf1ff81b0385232a6ce3e9328879cecc10730e 100644
|
| --- a/content/renderer/renderer_blink_platform_impl.cc
|
| +++ b/content/renderer/renderer_blink_platform_impl.cc
|
| @@ -1025,20 +1025,31 @@ RendererBlinkPlatformImpl::createOffscreenGraphicsContext3DProvider(
|
|
|
| bool is_software_rendering = gpu_channel_host->gpu_info().software_rendering;
|
|
|
| - // 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;
|
| +
|
| + attributes.own_offscreen_surface = web_attributes.ownOffscreenSurface;
|
| + if (web_attributes.ownOffscreenSurface) {
|
| + attributes.alpha_size = web_attributes.alpha ? 8 : -1;
|
| + attributes.depth_size = web_attributes.depth ? 24 : 0;
|
| + attributes.stencil_size = web_attributes.stencil ? 8 : 0;
|
| + attributes.samples = web_attributes.antialias ? 4 : 0;
|
| + attributes.sample_buffers = web_attributes.antialias ? 1 : 0;
|
| + } else {
|
| + // This is an offscreen context, which doesn't use the default frame buffer,
|
| + // so don't request any alpha, depth, stencil, antialiasing.
|
| + attributes.alpha_size = -1;
|
| + 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)
|
|
|