Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(788)

Unified Diff: content/renderer/render_widget.cc

Issue 16304003: Unified OutputSurface::SwapBuffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 205473 Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698