Index: content/renderer/render_widget.cc |
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
index 724b36760d4876ae532ab689a5e9c71e76d04722..8b3e621a761e388016049fd52bb61732450d85b1 100644 |
--- a/content/renderer/render_widget.cc |
+++ b/content/renderer/render_widget.cc |
@@ -26,6 +26,7 @@ |
#include "content/public/common/content_switches.h" |
#include "content/renderer/gpu/compositor_output_surface.h" |
#include "content/renderer/gpu/compositor_software_output_device.h" |
+#include "content/renderer/gpu/delegated_compositor_output_surface.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" |
@@ -600,7 +601,7 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() { |
if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) { |
return scoped_ptr<cc::OutputSurface>( |
new CompositorOutputSurface(routing_id(), NULL, |
- new CompositorSoftwareOutputDevice())); |
+ new CompositorSoftwareOutputDevice(), true)); |
} |
// Explicitly disable antialiasing for the compositor. As of the time of |
@@ -626,14 +627,18 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() { |
if (!context) |
return scoped_ptr<cc::OutputSurface>(); |
- bool composite_to_mailbox = |
- command_line.HasSwitch(cc::switches::kCompositeToMailbox) && |
- !command_line.HasSwitch(switches::kEnableDelegatedRenderer); |
- // 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)); |
+ if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) { |
+ DCHECK(is_threaded_compositing_enabled_); |
+ return scoped_ptr<cc::OutputSurface>( |
+ new DelegatedCompositorOutputSurface(routing_id(), context, NULL)); |
+ } |
+ if (command_line.HasSwitch(cc::switches::kCompositeToMailbox)) { |
+ DCHECK(is_threaded_compositing_enabled_); |
+ return scoped_ptr<cc::OutputSurface>( |
+ new MailboxOutputSurface(routing_id(), context, NULL)); |
+ } |
+ return scoped_ptr<cc::OutputSurface>( |
+ new CompositorOutputSurface(routing_id(), context, NULL, false)); |
} |
void RenderWidget::OnViewContextSwapBuffersAborted() { |