diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-12 00:58:35 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-12 00:58:35 +0000 |
commit | 8bbe3a92317499860e4b522aca6656ef93742d6c (patch) | |
tree | b21a310a7d97a9749496237e43e2bb607e3abce8 | |
parent | 59d4cad7c8812208721f09cb23e26b22c788dda9 (diff) | |
download | chromium_src-8bbe3a92317499860e4b522aca6656ef93742d6c.zip chromium_src-8bbe3a92317499860e4b522aca6656ef93742d6c.tar.gz chromium_src-8bbe3a92317499860e4b522aca6656ef93742d6c.tar.bz2 |
Revert 199551 "Reland "Clean up software compositing switches" p..."
Broke Win Aura:
http://build.chromium.org/p/chromium.win/builders/Win%20Aura%20Tests%20%281%29/builds/3836
Try jobs failed too:
http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win7_aura&number=38939
> Reland "Clean up software compositing switches" patch.
>
> After this patch just --disable-gpu should be enough to put Chrome in software compositing mode for Aura builds.
>
> TBR=piman@chromium.org,jamesr@chromium.org,jochen@chromium.org
> BUG=229712, 230120
>
> Review URL: https://codereview.chromium.org/15048003
TBR=skaslev@chromium.org
Review URL: https://codereview.chromium.org/14822009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199632 0039d316-1c4b-4281-b951-d872f2087c98
19 files changed, 29 insertions, 80 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 37a8e41..d65c37a 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -176,8 +176,6 @@ BrowserProcessImpl::BrowserProcessImpl( g_browser_process = this; platform_part_.reset(new BrowserProcessPlatformPart()); - gpu_mode_manager_.reset(new GpuModeManager); - #if defined(ENABLE_PRINTING) // Must be created after the NotificationService. print_job_manager_.reset(new printing::PrintJobManager); @@ -517,6 +515,9 @@ GLStringManager* BrowserProcessImpl::gl_string_manager() { } GpuModeManager* BrowserProcessImpl::gpu_mode_manager() { + DCHECK(CalledOnValidThread()); + if (!gpu_mode_manager_.get()) + gpu_mode_manager_.reset(new GpuModeManager()); return gpu_mode_manager_.get(); } diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index ce1e6ff..829d730 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -1314,6 +1314,9 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() { if (g_browser_process->gl_string_manager()) g_browser_process->gl_string_manager()->Initialize(); + // Create an instance of GpuModeManager to watch gpu mode pref change. + g_browser_process->gpu_mode_manager(); + #if !defined(OS_ANDROID) // Show the First Run UI if this is the first time Chrome has been run on // this computer, or we're being compelled to do so by a command line flag. diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc index 765cc18..f53094e 100644 --- a/content/browser/gpu/gpu_data_manager_impl.cc +++ b/content/browser/gpu/gpu_data_manager_impl.cc @@ -112,11 +112,6 @@ void GpuDataManagerImpl::DisableHardwareAcceleration() { private_->DisableHardwareAcceleration(); } -void GpuDataManagerImpl::EnableSoftwareCompositing() { - base::AutoLock auto_lock(lock_); - private_->EnableSoftwareCompositing(); -} - void GpuDataManagerImpl::Initialize() { base::AutoLock auto_lock(lock_); private_->Initialize(); diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h index 9e1b261..9e609b5 100644 --- a/content/browser/gpu/gpu_data_manager_impl.h +++ b/content/browser/gpu/gpu_data_manager_impl.h @@ -79,7 +79,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 diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc index 6796141..74fff17 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -20,7 +20,6 @@ #include "base/strings/string_piece.h" #include "base/sys_info.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 GpuDataManagerImplPrivate::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 GpuDataManagerImplPrivate::AppendGpuCommandLine( @@ -573,12 +567,6 @@ void GpuDataManagerImplPrivate::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 GpuDataManagerImplPrivate::GetGpuSwitchingOption() const { @@ -708,11 +696,6 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate() : 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), @@ -720,10 +703,6 @@ GpuDataManagerImplPrivate::GpuDataManagerImplPrivate() domain_blocking_enabled_(true), owner_(NULL) { CommandLine* command_line = CommandLine::ForCurrentProcess(); - - use_software_compositor_ |= - command_line->HasSwitch(switches::kEnableSoftwareCompositing); - if (command_line->HasSwitch(switches::kDisableAcceleratedCompositing)) { command_line->AppendSwitch(switches::kDisableAccelerated2dCanvas); command_line->AppendSwitch(switches::kDisableAcceleratedLayers); @@ -840,10 +819,6 @@ void GpuDataManagerImplPrivate::EnableSwiftShaderIfNecessary() { } } -void GpuDataManagerImplPrivate::EnableSoftwareCompositing() { - use_software_compositor_ = true; -} - std::string GpuDataManagerImplPrivate::GetDomainFromURL( const GURL& url) const { // For the moment, we just use the host, or its IP address, as the diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h index 8d40303..d8fc042 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.h +++ b/content/browser/gpu/gpu_data_manager_impl_private.h @@ -48,7 +48,6 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { std::string* gl_renderer, std::string* gl_version); void DisableHardwareAcceleration(); - void EnableSoftwareCompositing(); void Initialize(); @@ -210,10 +209,6 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate { ListValue log_messages_; - // 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_; diff --git a/content/browser/renderer_host/image_transport_factory.cc b/content/browser/renderer_host/image_transport_factory.cc index 79f3836..1e566ac 100644 --- a/content/browser/renderer_host/image_transport_factory.cc +++ b/content/browser/renderer_host/image_transport_factory.cc @@ -747,7 +747,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 20db99f..399de15 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -871,7 +871,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( // Allow this to be set when invoking the browser and relayed along. switches::kEnableSandboxLogging, #endif - switches::kEnableSoftwareCompositing, + switches::kEnableSoftwareCompositingGLAdapter, switches::kEnableStatsTable, switches::kEnableThreadedCompositing, switches::kEnableCompositingForFixedPosition, diff --git a/content/browser/renderer_host/render_widget_host_view_guest.cc b/content/browser/renderer_host/render_widget_host_view_guest.cc index 6919a58..6f02367 100644 --- a/content/browser/renderer_host/render_widget_host_view_guest.cc +++ b/content/browser/renderer_host/render_widget_host_view_guest.cc @@ -169,17 +169,6 @@ void RenderWidgetHostViewGuest::AcceleratedSurfacePostSubBuffer( void RenderWidgetHostViewGuest::OnSwapCompositorFrame( scoped_ptr<cc::CompositorFrame> frame) { - // TODO(skaslev) Implement this path for software compositing. - // For now we immediately acknowledge software frames to avoid - // blocking the renderer and breaking unittests. - if (frame->software_frame_data) { - cc::CompositorFrameAck ack; - ack.last_dib_id = frame->software_frame_data->dib_id; - RenderWidgetHostImpl::SendSwapCompositorFrameAck( - host_->GetRoutingID(), host_->GetProcess()->GetID(), ack); - return; - } - guest_->clear_damage_buffer(); guest_->SendMessageToEmbedder( new BrowserPluginMsg_CompositorFrameSwapped( diff --git a/content/public/browser/gpu_data_manager.h b/content/public/browser/gpu_data_manager.h index 6140a1b..f76907a 100644 --- a/content/public/browser/gpu_data_manager.h +++ b/content/public/browser/gpu_data_manager.h @@ -94,9 +94,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 683d4ae..a2dff32 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -461,8 +461,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 5c48da7..a196be1 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[]; @@ -127,7 +127,7 @@ extern const char kEnablePruneGpuCommandBuffers[]; extern const char kEnableSSLCachedInfo[]; extern const char kEnableSandboxLogging[]; 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 184aedc..d4a55d6 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -579,6 +579,12 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() { } #endif + 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 @@ -595,18 +601,8 @@ scoped_ptr<cc::OutputSurface> RenderWidget::CreateOutputSurface() { attributes.noAutomaticFlushes = true; WebGraphicsContext3DCommandBufferImpl* context = CreateGraphicsContext3D(attributes); - - 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) && @@ -2341,10 +2337,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/app/shell_main_delegate.cc b/content/shell/app/shell_main_delegate.cc index 61012b6..9ac38c9 100644 --- a/content/shell/app/shell_main_delegate.cc +++ b/content/shell/app/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/public/test/layouttest_support.h" @@ -117,11 +116,8 @@ bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { command_line.AppendSwitch(switches::kEnableCssShaders); command_line.AppendSwitchASCII(switches::kTouchEvents, switches::kTouchEventsEnabled); - - // TODO(skaslev) Remove that after codereview.chromium.org/14615005/ - // lands and rolls. if (command_line.HasSwitch(switches::kEnableSoftwareCompositing)) - GpuDataManager::GetInstance()->DisableHardwareAcceleration(); + command_line.AppendSwitch(switches::kEnableSoftwareCompositingGLAdapter); net::CookieMonster::EnableFileScheme(); if (!WebKitTestPlatformInitialize()) { diff --git a/content/shell/common/shell_switches.cc b/content/shell/common/shell_switches.cc index 04a5f44..6cc052a 100644 --- a/content/shell/common/shell_switches.cc +++ b/content/shell/common/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/common/shell_switches.h b/content/shell/common/shell_switches.h index 659b22a..5a182c5 100644 --- a/content/shell/common/shell_switches.h +++ b/content/shell/common/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 34bc44d..a8bb5bb 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/common/shell_messages.h" #include "content/shell/common/shell_switches.h" #include "content/shell/common/webkit_test_helpers.h" diff --git a/ui/compositor/compositor_switches.cc b/ui/compositor/compositor_switches.cc index b160712..7f1bd23 100644 --- a/ui/compositor/compositor_switches.cc +++ b/ui/compositor/compositor_switches.cc @@ -10,6 +10,8 @@ const char kDisableTestCompositor[] = "disable-test-compositor"; const char kUIDisableThreadedCompositing[] = "ui-disable-threaded-compositing"; +const char kUIEnableSoftwareCompositing[] = "ui-enable-software-compositing"; + const char kUIEnableThreadedCompositing[] = "ui-enable-threaded-compositing"; const char kUIMaxFramesPending[] = "ui-max-frames-pending"; diff --git a/ui/compositor/compositor_switches.h b/ui/compositor/compositor_switches.h index 85708a7..5b59477 100644 --- a/ui/compositor/compositor_switches.h +++ b/ui/compositor/compositor_switches.h @@ -11,6 +11,7 @@ namespace switches { COMPOSITOR_EXPORT extern const char kDisableTestCompositor[]; COMPOSITOR_EXPORT extern const char kUIDisableThreadedCompositing[]; +COMPOSITOR_EXPORT extern const char kUIEnableSoftwareCompositing[]; COMPOSITOR_EXPORT extern const char kUIEnableThreadedCompositing[]; COMPOSITOR_EXPORT extern const char kUIMaxFramesPending[]; COMPOSITOR_EXPORT extern const char kUIShowPaintRects[]; |