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

Unified Diff: content/renderer/render_widget.cc

Issue 19267016: Add a flag to allow renderer to use software compositor when GL compositor doesn't work. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/render_widget.h ('k') | content/shell/app/shell_main_delegate.cc » ('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 36b1e31b240a13e8d975e2448bf8e475807ba3bc..8f593b89b07fe2fbe4b6b34696311383b80f70ab 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -635,7 +635,7 @@ bool RenderWidget::ForceCompositingModeEnabled() {
return false;
}
-scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
+scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface(bool fallback) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
#if defined(OS_ANDROID)
@@ -647,12 +647,6 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
uint32 output_surface_id = next_output_surface_id_++;
- if (command_line.HasSwitch(switches::kEnableSoftwareCompositingGLAdapter)) {
- return scoped_ptr<cc::OutputSurface>(
- new CompositorOutputSurface(routing_id(), output_surface_id, NULL,
- new CompositorSoftwareOutputDevice(), true));
- }
-
// 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
@@ -671,10 +665,20 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
attributes.stencil = false;
if (command_line.HasSwitch(cc::switches::kForceDirectLayerDrawing))
attributes.stencil = true;
- WebGraphicsContext3DCommandBufferImpl* context =
- CreateGraphicsContext3D(attributes);
- if (!context)
- return scoped_ptr<cc::OutputSurface>();
+ WebGraphicsContext3DCommandBufferImpl* context = NULL;
+ if (!fallback)
+ context = CreateGraphicsContext3D(attributes);
+
+ if (!context) {
+ if (!command_line.HasSwitch(switches::kEnableSoftwareCompositing))
+ return scoped_ptr<cc::OutputSurface>();
+ return scoped_ptr<cc::OutputSurface>(
+ new CompositorOutputSurface(routing_id(),
+ output_surface_id,
+ NULL,
+ new CompositorSoftwareOutputDevice(),
+ true));
+ }
if (command_line.HasSwitch(switches::kEnableDelegatedRenderer) &&
!command_line.HasSwitch(switches::kDisableDelegatedRenderer)) {
@@ -2480,6 +2484,9 @@ WebGraphicsContext3DCommandBufferImpl* RenderWidget::CreateGraphicsContext3D(
const WebKit::WebGraphicsContext3D::Attributes& attributes) {
if (!webwidget_)
return NULL;
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableGpuCompositing))
+ return NULL;
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
new WebGraphicsContext3DCommandBufferImpl(
surface_id(),
« no previous file with comments | « content/renderer/render_widget.h ('k') | content/shell/app/shell_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698