Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index 3c9e7856b210e443f9fd709b74dfd9be106912d0..71b65d7a7c4364dbd42acb8e4c37ac4dfa3ef09a 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -70,6 +70,7 @@ |
#include "content/renderer/geolocation_dispatcher.h" |
#include "content/renderer/gpu/compositor_thread.h" |
#include "content/renderer/gpu/compositor_output_surface.h" |
+#include "content/renderer/gpu/compositor_output_surface_software_gl_adapter.h" |
#include "content/renderer/idle_user_detector.h" |
#include "content/renderer/input_tag_speech_dispatcher.h" |
#include "content/renderer/java/java_bridge_dispatcher.h" |
@@ -1804,9 +1805,6 @@ WebStorageNamespace* RenderViewImpl::createSessionStorageNamespace( |
} |
WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { |
- // TODO(aelias): if force-software-mode is on, create an output surface |
- // without a 3D context. |
- |
// 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 |
@@ -1824,7 +1822,15 @@ WebKit::WebCompositorOutputSurface* RenderViewImpl::createOutputSurface() { |
if (!context) |
return NULL; |
- return new CompositorOutputSurface(routing_id(), context); |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { |
+ // In the absence of a software-based delegating renderer, use this |
+ // stopgap adapter class to present the software renderer output using a |
+ // 3d context. |
+ return new CompositorOutputSurface(routing_id(), NULL, |
+ new CompositorOutputSurfaceSoftwareGLAdapter(context)); |
+ } else |
+ return new CompositorOutputSurface(routing_id(), context, NULL); |
} |
void RenderViewImpl::didAddMessageToConsole( |