summaryrefslogtreecommitdiffstats
path: root/content/renderer/render_widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/renderer/render_widget.cc')
-rw-r--r--content/renderer/render_widget.cc27
1 files changed, 9 insertions, 18 deletions
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 5dd4637..f8d3137 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -555,6 +555,13 @@ bool RenderWidget::ForceCompositingModeEnabled() {
}
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
@@ -571,20 +578,8 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
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>();
bool composite_to_mailbox =
command_line.HasSwitch(cc::switches::kCompositeToMailbox);
@@ -2305,10 +2300,6 @@ WebGraphicsContext3DCommandBufferImpl* RenderWidget::CreateGraphicsContext3D(
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(),