Chromium Code Reviews| Index: content/renderer/render_widget.cc |
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
| index b871f2b41fcb82f76e5983262013c3e827ac774d..c33ce1f68a2e34acfae9aa53e3f356460b4da2c8 100644 |
| --- a/content/renderer/render_widget.cc |
| +++ b/content/renderer/render_widget.cc |
| @@ -908,30 +908,37 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) { |
| } |
| #endif |
| - // Explicitly disable antialiasing for the compositor. As of the time of |
| - // this writing, the only platform that supported antialiasing for the |
| - // compositor was Mac OS X, because the on-screen OpenGL context creation |
| - // code paths on Windows and Linux didn't yet have multisampling support. |
| - // Mac OS X essentially always behaves as though it's rendering offscreen. |
| - // Multisampling has a heavy cost especially on devices with relatively low |
| - // fill rate like most notebooks, and the Mac implementation would need to |
| - // be optimized to resolve directly into the IOSurface shared between the |
| - // GPU and browser processes. For these reasons and to avoid platform |
| - // disparities we explicitly disable antialiasing. |
| - blink::WebGraphicsContext3D::Attributes attributes; |
| - attributes.antialias = false; |
| - attributes.shareResources = true; |
| - attributes.noAutomaticFlushes = true; |
| - attributes.depth = false; |
| - attributes.stencil = false; |
| - |
| const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + bool use_software = fallback; |
| + if (command_line.HasSwitch(switches::kDisableGpuCompositing)) |
| + use_software = true; |
| + |
| scoped_refptr<ContextProviderCommandBuffer> context_provider; |
| - if (!fallback) { |
| + if (!use_software) { |
| + // Explicitly disable antialiasing for the compositor. As of the time of |
| + // this writing, the only platform that supported antialiasing for the |
| + // compositor was Mac OS X, because the on-screen OpenGL context creation |
| + // code paths on Windows and Linux didn't yet have multisampling support. |
| + // Mac OS X essentially always behaves as though it's rendering offscreen. |
| + // Multisampling has a heavy cost especially on devices with relatively low |
| + // fill rate like most notebooks, and the Mac implementation would need to |
| + // be optimized to resolve directly into the IOSurface shared between the |
| + // GPU and browser processes. For these reasons and to avoid platform |
| + // disparities we explicitly disable antialiasing. |
| + blink::WebGraphicsContext3D::Attributes attributes; |
| + attributes.antialias = false; |
| + attributes.shareResources = true; |
| + attributes.noAutomaticFlushes = true; |
| + attributes.depth = false; |
| + attributes.stencil = false; |
| context_provider = ContextProviderCommandBuffer::Create( |
| CreateGraphicsContext3D(attributes), |
| "RenderCompositor"); |
| } |
| + if (!context_provider.get() && !fallback) { |
|
jbauman
2014/03/26 17:17:26
We should check for use_software here, because if
danakj
2014/03/26 17:21:22
Oh, that's what I was going for but didn't capture
danakj
2014/03/26 17:22:39
Done.
|
| + // Cause the compositor to wait and try again. |
| + return scoped_ptr<cc::OutputSurface>(); |
|
jbauman
2014/03/26 17:17:26
Does this always cause it to retry, even with the
danakj
2014/03/26 17:21:22
Yes. https://code.google.com/p/chromium/codesearch
|
| + } |
| uint32 output_surface_id = next_output_surface_id_++; |
| if (command_line.HasSwitch(switches::kEnableDelegatedRenderer) && |