Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index 16872d83246fe385e7d37fd59e0d04bccbd4435d..70808859213bd3687851eeac17bef7e28d0f2961 100644 |
--- a/content/renderer/render_widget.cc |
+++ b/content/renderer/render_widget.cc |
@@ -24,7 +24,6 @@ |
#include "content/common/view_messages.h" |
#include "content/public/common/content_switches.h" |
#include "content/renderer/gpu/compositor_output_surface.h" |
-#include "content/renderer/gpu/compositor_software_output_device_gl_adapter.h" |
#include "content/renderer/gpu/input_handler_manager.h" |
#include "content/renderer/gpu/mailbox_output_surface.h" |
#include "content/renderer/gpu/render_widget_compositor.h" |
@@ -57,6 +56,12 @@ |
#include "webkit/plugins/npapi/webplugin.h" |
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
+#if defined(USE_AURA) |
+#include "content/renderer/gpu/compositor_software_output_device.h" |
+#else |
+#include "content/renderer/gpu/compositor_software_output_device_gl_adapter.h" |
+#endif // defined(USE_AURA) |
+ |
#if defined(OS_POSIX) |
#include "ipc/ipc_channel_posix.h" |
#include "third_party/skia/include/core/SkMallocPixelRef.h" |
@@ -555,6 +560,16 @@ bool RenderWidget::ForceCompositingModeEnabled() { |
} |
scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() { |
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ |
+#if defined(USE_AURA) |
piman
2013/04/03 18:31:26
AURA is really a UI concept, which shouldn't have
slavi
2013/04/03 21:38:22
Done.
I'll rename the flag in a separate CL that
|
+ if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { |
+ return scoped_ptr<cc::OutputSurface>( |
+ new CompositorOutputSurface(routing_id(), NULL, |
+ new CompositorSoftwareOutputDevice())); |
+ } |
+#endif // defined(USE_AURA) |
+ |
// 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 |
@@ -573,25 +588,23 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() { |
if (!context) |
return scoped_ptr<cc::OutputSurface>(); |
- const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+#if !defined(USE_AURA) |
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 scoped_ptr<cc::OutputSurface>( |
new CompositorOutputSurface(routing_id(), NULL, |
new CompositorSoftwareOutputDeviceGLAdapter(context))); |
- } else { |
- bool composite_to_mailbox = |
- command_line.HasSwitch(cc::switches::kCompositeToMailbox); |
- DCHECK(!composite_to_mailbox || command_line.HasSwitch( |
- cc::switches::kEnableCompositorFrameMessage)); |
- // No swap throttling yet when compositing on the main thread. |
- DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); |
- return scoped_ptr<cc::OutputSurface>(composite_to_mailbox ? |
- new MailboxOutputSurface(routing_id(), context, NULL) : |
- new CompositorOutputSurface(routing_id(), context, NULL)); |
} |
+#endif // !defined(USE_AURA) |
+ |
+ bool composite_to_mailbox = |
+ command_line.HasSwitch(cc::switches::kCompositeToMailbox); |
+ DCHECK(!composite_to_mailbox || command_line.HasSwitch( |
+ cc::switches::kEnableCompositorFrameMessage)); |
+ // No swap throttling yet when compositing on the main thread. |
+ DCHECK(!composite_to_mailbox || is_threaded_compositing_enabled_); |
+ return scoped_ptr<cc::OutputSurface>(composite_to_mailbox ? |
+ new MailboxOutputSurface(routing_id(), context, NULL) : |
+ new CompositorOutputSurface(routing_id(), context, NULL)); |
} |
void RenderWidget::OnViewContextSwapBuffersAborted() { |