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

Unified Diff: content/renderer/render_widget.cc

Issue 13042012: Browser side changes for software compositing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/compositor_software_output_device.cc ('k') | no next file » | 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 16872d83246fe385e7d37fd59e0d04bccbd4435d..b32b327bb826ff692bacf0857c9cc7f3bcfaf967 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -24,7 +24,7 @@
#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/compositor_software_output_device.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"
@@ -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
@@ -573,25 +580,15 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
if (!context)
return scoped_ptr<cc::OutputSurface>();
- 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 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));
- }
+ 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() {
« no previous file with comments | « content/renderer/gpu/compositor_software_output_device.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698