summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authortzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-01 11:11:21 +0000
committertzik@chromium.org <tzik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-01 11:11:21 +0000
commit5255d304cdf20a8f35553bb19d60d0abb6758464 (patch)
tree17cb383c4300b77d1de0c1138176a7636ce16043 /content
parentadef9ab9c81b9b320fa6bf4a452e717496bb6e18 (diff)
downloadchromium_src-5255d304cdf20a8f35553bb19d60d0abb6758464.zip
chromium_src-5255d304cdf20a8f35553bb19d60d0abb6758464.tar.gz
chromium_src-5255d304cdf20a8f35553bb19d60d0abb6758464.tar.bz2
Revert 197493 "Clean up software compositing switches. "
> Clean up software compositing switches. > > After this patch just --disable-gpu should be enough to put Chrome in software compositing mode for Aura builds. > > NOTRY=true > > BUG=229712, 230120 > > Review URL: https://chromiumcodereview.appspot.com/13985036 TBR=skaslev@chromium.org Review URL: https://codereview.chromium.org/14769002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197599 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.cc25
-rw-r--r--content/browser/gpu/gpu_data_manager_impl.h6
-rw-r--r--content/browser/renderer_host/image_transport_factory.cc2
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc2
-rw-r--r--content/public/browser/gpu_data_manager.h3
-rw-r--r--content/public/common/content_switches.cc5
-rw-r--r--content/public/common/content_switches.h4
-rw-r--r--content/renderer/render_widget.cc27
-rw-r--r--content/shell/shell_main_delegate.cc9
-rw-r--r--content/shell/shell_switches.cc3
-rw-r--r--content/shell/shell_switches.h1
-rw-r--r--content/shell/webkit_test_controller.cc1
12 files changed, 23 insertions, 65 deletions
diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
index f9b2f3e..e6fc470 100644
--- a/content/browser/gpu/gpu_data_manager_impl.cc
+++ b/content/browser/gpu/gpu_data_manager_impl.cc
@@ -20,7 +20,6 @@
#include "base/sys_info.h"
#include "base/values.h"
#include "base/version.h"
-#include "cc/base/switches.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/gpu/gpu_util.h"
#include "content/common/gpu/gpu_messages.h"
@@ -422,11 +421,6 @@ void GpuDataManagerImpl::AppendRendererCommandLine(
command_line->AppendSwitch(switches::kDisableAcceleratedVideoDecode);
if (ShouldUseSwiftShader())
command_line->AppendSwitch(switches::kDisableFlashFullscreen3d);
-
- if (card_blacklisted_ && use_software_compositor_) {
- command_line->AppendSwitch(switches::kEnableSoftwareCompositing);
- command_line->AppendSwitch(cc::switches::kEnableCompositorFrameMessage);
- }
}
void GpuDataManagerImpl::AppendGpuCommandLine(
@@ -576,12 +570,6 @@ void GpuDataManagerImpl::UpdateRendererWebPrefs(
prefs->accelerated_compositing_for_3d_transforms_enabled = false;
prefs->accelerated_compositing_for_plugins_enabled = false;
}
-
- if (card_blacklisted_ && use_software_compositor_) {
- prefs->accelerated_compositing_enabled = true;
- prefs->accelerated_compositing_for_3d_transforms_enabled = true;
- prefs->accelerated_compositing_for_animation_enabled = true;
- }
}
GpuSwitchingOption GpuDataManagerImpl::GetGpuSwitchingOption() const {
@@ -596,10 +584,6 @@ void GpuDataManagerImpl::DisableHardwareAcceleration() {
for (int i = 0; i < NUMBER_OF_GPU_FEATURE_TYPES; ++i)
blacklisted_features_.insert(i);
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (!command_line->HasSwitch(switches::kDisableGpu))
- command_line->AppendSwitch(switches::kDisableGpu);
-
EnableSwiftShaderIfNecessary();
NotifyGpuInfoUpdate();
}
@@ -702,11 +686,6 @@ GpuDataManagerImpl::GpuDataManagerImpl()
: complete_gpu_info_already_requested_(false),
gpu_switching_(GPU_SWITCHING_OPTION_AUTOMATIC),
observer_list_(new GpuDataManagerObserverList),
-#if defined(USE_AURA)
- use_software_compositor_(true),
-#else
- use_software_compositor_(false),
-#endif
use_swiftshader_(false),
card_blacklisted_(false),
update_histograms_(true),
@@ -831,10 +810,6 @@ void GpuDataManagerImpl::EnableSwiftShaderIfNecessary() {
}
}
-void GpuDataManagerImpl::EnableSoftwareCompositing() {
- use_software_compositor_ = true;
-}
-
std::string GpuDataManagerImpl::GetDomainFromURL(const GURL& url) const {
// For the moment, we just use the host, or its IP address, as the
// entry in the set, rather than trying to figure out the top-level
diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
index 9683e89..0bca69b 100644
--- a/content/browser/gpu/gpu_data_manager_impl.h
+++ b/content/browser/gpu/gpu_data_manager_impl.h
@@ -89,7 +89,6 @@ class CONTENT_EXPORT GpuDataManagerImpl
std::string* gl_renderer,
std::string* gl_version) OVERRIDE;
virtual void DisableHardwareAcceleration() OVERRIDE;
- virtual void EnableSoftwareCompositing() OVERRIDE;
// This collects preliminary GPU info, load GpuBlacklist, and compute the
// preliminary blacklisted features; it should only be called at browser
@@ -274,11 +273,8 @@ class CONTENT_EXPORT GpuDataManagerImpl
ListValue log_messages_;
mutable base::Lock log_messages_lock_;
- // TODO(skaslev) Remove this after all legacy s/w rendering paths are removed.
- // Then use_software_compositor_ will be implicitly always true.
- bool use_software_compositor_;
-
bool use_swiftshader_;
+
base::FilePath swiftshader_path_;
// Current card force-blacklisted due to GPU crashes, or disabled through
diff --git a/content/browser/renderer_host/image_transport_factory.cc b/content/browser/renderer_host/image_transport_factory.cc
index 67661bf..249cb8e 100644
--- a/content/browser/renderer_host/image_transport_factory.cc
+++ b/content/browser/renderer_host/image_transport_factory.cc
@@ -746,7 +746,7 @@ void ImageTransportFactory::Initialize() {
}
if (ui::IsTestCompositorEnabled()) {
g_factory = new NoTransportFactory(new ui::TestContextFactory);
- } else if (command_line->HasSwitch(switches::kDisableGpu)) {
+ } else if (command_line->HasSwitch(switches::kUIEnableSoftwareCompositing)) {
g_factory = new NoTransportFactory(new SoftwareContextFactory);
} else {
g_factory = new GpuProcessTransportFactory;
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index f2571dc..3498062 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -867,7 +867,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableSandboxLogging,
#endif
switches::kEnableSeccompSandbox,
- switches::kEnableSoftwareCompositing,
+ switches::kEnableSoftwareCompositingGLAdapter,
switches::kEnableStatsTable,
switches::kEnableThreadedCompositing,
switches::kEnableCompositingForFixedPosition,
diff --git a/content/public/browser/gpu_data_manager.h b/content/public/browser/gpu_data_manager.h
index 2348eff..d43bc73 100644
--- a/content/public/browser/gpu_data_manager.h
+++ b/content/public/browser/gpu_data_manager.h
@@ -92,9 +92,6 @@ class GpuDataManager {
// Turn off all hardware acceleration.
virtual void DisableHardwareAcceleration() = 0;
- // Enable software compositing path.
- virtual void EnableSoftwareCompositing() = 0;
-
protected:
virtual ~GpuDataManager() {}
};
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 3a6f474..8929515 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -452,8 +452,9 @@ const char kForceFieldTrials[] = "force-fieldtrials";
// overrides this if present.
const char kForceRendererAccessibility[] = "force-renderer-accessibility";
-// Enable software compositing.
-const char kEnableSoftwareCompositing[] = "enable-software-compositing";
+// Force the compositor to use its software implementation instead of GL.
+const char kEnableSoftwareCompositingGLAdapter[] =
+ "enable-software-compositing-gl-adapter";
// Passes gpu device_id from browser process to GPU process.
const char kGpuDeviceID[] = "gpu-device-id";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 2f0195a..4692f9e 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -49,7 +49,7 @@ CONTENT_EXPORT extern const char kDisableFlashStage3d[];
CONTENT_EXPORT extern const char kDisableForceCompositingMode[];
extern const char kDisableGeolocation[];
CONTENT_EXPORT extern const char kUseGpuInTests[];
-CONTENT_EXPORT extern const char kDisableGpu[];
+extern const char kDisableGpu[];
CONTENT_EXPORT extern const char kDisableGLMultisampling[];
CONTENT_EXPORT extern const char kDisableGpuProcessPrelaunch[];
extern const char kDisableGpuSandbox[];
@@ -126,7 +126,7 @@ extern const char kEnableSSLCachedInfo[];
extern const char kEnableSandboxLogging[];
extern const char kEnableSeccompSandbox[];
extern const char kEnableSpatialNavigation[];
-CONTENT_EXPORT extern const char kEnableSoftwareCompositing[];
+CONTENT_EXPORT extern const char kEnableSoftwareCompositingGLAdapter[];
CONTENT_EXPORT extern const char kEnableSmoothScrolling[];
CONTENT_EXPORT extern const char kEnableStatsTable[];
extern const char kEnableStrictSiteIsolation[];
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 5dd4637..f8d3137 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -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
@@ -571,20 +578,8 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() {
attributes.noAutomaticFlushes = true;
WebGraphicsContext3DCommandBufferImpl* context =
CreateGraphicsContext3D(attributes);
-
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
- if (!context) {
- if (command_line.HasSwitch(switches::kEnableSoftwareCompositing)) {
- // If we failed to create context, return output surface set up for
- // software compositing.
- return scoped_ptr<cc::OutputSurface>(
- new CompositorOutputSurface(routing_id(), NULL,
- new CompositorSoftwareOutputDevice()));
- } else {
- return scoped_ptr<cc::OutputSurface>();
- }
- }
+ if (!context)
+ return scoped_ptr<cc::OutputSurface>();
bool composite_to_mailbox =
command_line.HasSwitch(cc::switches::kCompositeToMailbox);
@@ -2305,10 +2300,6 @@ WebGraphicsContext3DCommandBufferImpl* RenderWidget::CreateGraphicsContext3D(
const WebKit::WebGraphicsContext3D::Attributes& attributes) {
if (!webwidget_)
return NULL;
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableGpu))
- return NULL;
-
scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context(
new WebGraphicsContext3DCommandBufferImpl(
surface_id(),
diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc
index e23da93..2080988 100644
--- a/content/shell/shell_main_delegate.cc
+++ b/content/shell/shell_main_delegate.cc
@@ -9,7 +9,6 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "content/public/browser/browser_main_runner.h"
-#include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/url_constants.h"
#include "content/shell/shell_browser_main.h"
@@ -116,12 +115,8 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) {
command_line.AppendSwitch(switches::kEnableCssShaders);
command_line.AppendSwitchASCII(switches::kTouchEvents,
switches::kTouchEventsEnabled);
- if (command_line.HasSwitch(switches::kEnableSoftwareCompositing)) {
- GpuDataManager* gpu_data_manager = GpuDataManager::GetInstance();
- gpu_data_manager->EnableSoftwareCompositing();
- gpu_data_manager->DisableHardwareAcceleration();
- command_line.AppendSwitch(switches::kForceCompositingMode);
- }
+ if (command_line.HasSwitch(switches::kEnableSoftwareCompositing))
+ command_line.AppendSwitch(switches::kEnableSoftwareCompositingGLAdapter);
net::CookieMonster::EnableFileScheme();
if (!WebKitTestPlatformInitialize()) {
diff --git a/content/shell/shell_switches.cc b/content/shell/shell_switches.cc
index a0b891f..e607cdc 100644
--- a/content/shell/shell_switches.cc
+++ b/content/shell/shell_switches.cc
@@ -28,6 +28,9 @@ const char kDumpRenderTree[] = "dump-render-tree";
// Enable accelerated 2D canvas.
const char kEnableAccelerated2DCanvas[] = "enable-accelerated-2d-canvas";
+// Alias for kEnableSoftwareCompositingGLAdapter.
+const char kEnableSoftwareCompositing[] = "enable-software-compositing";
+
// Disables the timeout for layout tests.
const char kNoTimeout[] = "no-timeout";
diff --git a/content/shell/shell_switches.h b/content/shell/shell_switches.h
index 1111fbf..e89ff26 100644
--- a/content/shell/shell_switches.h
+++ b/content/shell/shell_switches.h
@@ -16,6 +16,7 @@ extern const char kContentShellDataPath[];
extern const char kDisableHeadlessForLayoutTests[];
extern const char kDumpRenderTree[];
extern const char kEnableAccelerated2DCanvas[];
+extern const char kEnableSoftwareCompositing[];
extern const char kNoTimeout[];
extern const char kOutputLayoutTestDifferences[];
diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc
index 4c1ba7a..7af5ef8 100644
--- a/content/shell/webkit_test_controller.cc
+++ b/content/shell/webkit_test_controller.cc
@@ -23,7 +23,6 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
-#include "content/public/common/content_switches.h"
#include "content/shell/shell.h"
#include "content/shell/shell_browser_context.h"
#include "content/shell/shell_content_browser_client.h"