Revert 197751 "Clean up software compositing switches. "
> Clean up software compositing switches.
>
> After this patch just --disable-gpu should be enough to put Chrome in software compositing mode for Aura builds.
>
> Relanding https://codereview.chromium.org/13985036 which got a speculative revert.
>
> [email protected],[email protected],[email protected]
> NOTRY=true
> BUG=229712,230120
>
> Review URL: https://chromiumcodereview.appspot.com/14598004
[email protected]
Review URL: https://codereview.chromium.org/14620006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197812 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index e895ebf4..b681e5d 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -559,6 +559,13 @@
}
scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) {
+ return scoped_ptr<cc::OutputSurface>(
+ new CompositorOutputSurface(routing_id(), NULL,
+ new CompositorSoftwareOutputDevice()));
+ }
+
// 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
@@ -575,20 +582,8 @@
attributes.noAutomaticFlushes = true;
WebGraphicsContext3DCommandBufferImpl* context =
CreateGraphicsContext3D(attributes);
-
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
- if (!context) {
- if (command_line.HasSwitch(switches::kEnableSoftwareCompositing)) {
- // If we failed to create context, return output surface set up for
- // software compositing.
- return scoped_ptr<cc::OutputSurface>(
- new CompositorOutputSurface(routing_id(), NULL,
- new CompositorSoftwareOutputDevice()));
- } else {
- return scoped_ptr<cc::OutputSurface>();
- }
- }
+ if (!context)
+ return scoped_ptr<cc::OutputSurface>();
#if defined(OS_ANDROID)
if (command_line.HasSwitch(switches::kEnableSynchronousRendererCompositor)) {
@@ -2319,10 +2314,6 @@
const WebKit::WebGraphicsContext3D::Attributes& attributes) {
if (!webwidget_)
return NULL;
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpu))
- return NULL;
-
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
new WebGraphicsContext3DCommandBufferImpl(
surface_id(),