Remove EnableThreadedCompositing from the browser.
Now only --disable-threaded-compositing exists, which is only present
for layout tests. The --enable-threaded-compositing flag moves to
become a content shell flag only, as it's only used for DumpRenderTree.
Change any checks in the renderer process for kEnableThreadedCompositing
to instead be !kDisableThreadedCompositing since that is the only
flag left.
Remove the whole threaded compositing thing from about:gpu and
about:flags.
R=piman
BUG=384381,346363
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=278151
Review URL: https://codereview.chromium.org/337783002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283870 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 181408b..c1f8e3f 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -536,18 +536,6 @@
SINGLE_VALUE_TYPE(switches::kIgnoreGpuBlacklist)
},
{
- "threaded-compositing-mode",
- IDS_FLAGS_THREADED_COMPOSITING_MODE_NAME,
- IDS_FLAGS_THREADED_COMPOSITING_MODE_DESCRIPTION,
-#if !defined(USE_AURA)
- kOsLinux,
-#else
- 0,
-#endif
- ENABLE_DISABLE_VALUE_TYPE(switches::kEnableThreadedCompositing,
- switches::kDisableThreadedCompositing)
- },
- {
"force-accelerated-composited-scrolling",
IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_NAME,
IDS_FLAGS_FORCE_ACCELERATED_OVERFLOW_SCROLL_MODE_DESCRIPTION,
diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc
index ae4fe5a..d90e077 100644
--- a/chrome/browser/chromeos/login/chrome_restart_request.cc
+++ b/chrome/browser/chromeos/login/chrome_restart_request.cc
@@ -89,7 +89,6 @@
::switches::kDisablePanelFitting,
::switches::kDisableSeccompFilterSandbox,
::switches::kDisableSetuidSandbox,
- ::switches::kDisableThreadedCompositing,
::switches::kDisableTouchDragDrop,
::switches::kDisableTouchEditing,
::switches::kDisableAcceleratedFixedRootBackground,
@@ -111,7 +110,6 @@
::switches::kEnableLowResTiling,
::switches::kEnableOneCopy,
::switches::kEnablePinch,
- ::switches::kEnableThreadedCompositing,
::switches::kEnableTouchDragDrop,
::switches::kEnableTouchEditing,
::switches::kEnableViewport,
diff --git a/content/browser/android/content_startup_flags.cc b/content/browser/android/content_startup_flags.cc
index d472b5f..f185691 100644
--- a/content/browser/android/content_startup_flags.cc
+++ b/content/browser/android/content_startup_flags.cc
@@ -56,7 +56,6 @@
RenderProcessHost::SetMaxRendererProcessCount(max_render_process_count);
}
- parsed_command_line->AppendSwitch(switches::kEnableThreadedCompositing);
parsed_command_line->AppendSwitch(
switches::kEnableCompositingForFixedPosition);
parsed_command_line->AppendSwitch(switches::kEnableAcceleratedOverflowScroll);
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index bcc6a9e..844f63d 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -178,24 +178,6 @@
#endif
}
-bool IsThreadedCompositingEnabled() {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
- // Command line switches take precedence over blacklist.
- if (command_line.HasSwitch(switches::kDisableThreadedCompositing))
- return false;
- if (command_line.HasSwitch(switches::kEnableThreadedCompositing))
- return true;
-
-#if defined(USE_AURA) || defined(OS_MACOSX)
- // We always want threaded compositing on Aura and Mac (the fallback is a
- // threaded software compositor).
- return true;
-#else
- return false;
-#endif
-}
-
bool IsDelegatedRendererEnabled() {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
bool enabled = false;
@@ -208,14 +190,6 @@
// Flags override.
enabled |= command_line.HasSwitch(switches::kEnableDelegatedRenderer);
enabled &= !command_line.HasSwitch(switches::kDisableDelegatedRenderer);
-
- // Needs compositing, and thread.
- if (enabled && !IsThreadedCompositingEnabled()) {
- enabled = false;
- LOG(ERROR) << "Disabling delegated-rendering because it needs "
- << "threaded-compositing.";
- }
-
return enabled;
}
@@ -233,7 +207,7 @@
#if defined(OS_MACOSX) || defined(OS_WIN)
return false;
#else
- return IsThreadedCompositingEnabled();
+ return true;
#endif
}
@@ -303,10 +277,6 @@
if (gpu_feature_info.name == kThreadedRasterizationFeatureName)
status += "_on";
}
- if (gpu_feature_info.name == kGpuCompositingFeatureName) {
- if (IsThreadedCompositingEnabled())
- status += "_threaded";
- }
if (gpu_feature_info.name == kWebGLFeatureName &&
(gpu_feature_info.blocked || gpu_access_blocked) &&
manager->ShouldUseSwiftShader()) {
diff --git a/content/browser/gpu/compositor_util.h b/content/browser/gpu/compositor_util.h
index 72a3ac0d..3ce396e 100644
--- a/content/browser/gpu/compositor_util.h
+++ b/content/browser/gpu/compositor_util.h
@@ -17,9 +17,6 @@
// flags, or platform default).
CONTENT_EXPORT bool IsPinchVirtualViewportEnabled();
-// Returns true if the threaded compositor is on (via flags or field trial).
-CONTENT_EXPORT bool IsThreadedCompositingEnabled();
-
// Returns true if delegated-renderer is on (via flags, or platform default).
CONTENT_EXPORT bool IsDelegatedRendererEnabled();
diff --git a/content/browser/gpu/compositor_util_browsertest.cc b/content/browser/gpu/compositor_util_browsertest.cc
index 0c563c5..550d777 100644
--- a/content/browser/gpu/compositor_util_browsertest.cc
+++ b/content/browser/gpu/compositor_util_browsertest.cc
@@ -15,37 +15,19 @@
typedef ContentBrowserTest CompositorUtilTest;
-// Test that threaded compositing and FCM are in the expected mode on the bots
-// for all platforms.
+// Test that compositing is in the expected mode on the bots for all platforms.
IN_PROC_BROWSER_TEST_F(CompositorUtilTest, CompositingModeAsExpected) {
enum CompositingMode {
- DISABLED,
- ENABLED,
- THREADED, // Implies FCM
- DELEGATED, // Implies threaded
- } expected_mode = DISABLED;
-#if defined(USE_AURA)
- expected_mode = DELEGATED;
-#elif defined(OS_ANDROID)
+ DIRECT,
+ DELEGATED,
+ } expected_mode = DIRECT;
+#if defined(USE_AURA) || defined(OS_ANDROID)
expected_mode = DELEGATED;
#elif defined(OS_MACOSX)
expected_mode = DELEGATED;
- // Lion and SnowLeopard have compositing blacklisted when using the Apple
- // software renderer, so results will vary depending if this test is being
- // run in a VM versus actual hardware.
- // http://crbug.com/230931
- if (base::mac::IsOSLionOrEarlier())
- return;
-#elif defined(OS_WIN)
- if (base::win::GetVersion() >= base::win::VERSION_VISTA)
- expected_mode = THREADED;
#endif
- EXPECT_EQ(expected_mode == THREADED ||
- expected_mode == DELEGATED,
- IsThreadedCompositingEnabled());
- EXPECT_EQ(expected_mode == DELEGATED,
- IsDelegatedRendererEnabled());
+ EXPECT_EQ(expected_mode == DELEGATED, IsDelegatedRendererEnabled());
}
}
diff --git a/content/browser/renderer_host/input/touch_input_browsertest.cc b/content/browser/renderer_host/input/touch_input_browsertest.cc
index 758f3ec..13c49f2a 100644
--- a/content/browser/renderer_host/input/touch_input_browsertest.cc
+++ b/content/browser/renderer_host/input/touch_input_browsertest.cc
@@ -183,14 +183,8 @@
GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
filter()->WaitForAck(WebInputEvent::TouchStart);
- if (content::IsThreadedCompositingEnabled()) {
- EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS,
- filter()->last_ack_state());
- } else {
- // http://crbug.com/326232: This should be NO_CONSUMER_EXISTS once
- // WebViewImpl::hasTouchEventHandlersAt() is implemented.
- EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, filter()->last_ack_state());
- }
+ EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS,
+ filter()->last_ack_state());
// If a touch-press is acked with NO_CONSUMER_EXISTS, then subsequent
// touch-points don't need to be dispatched until the touch point is released.
@@ -247,14 +241,8 @@
touch.PressPoint(25, 25);
GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
filter()->WaitForAck(WebInputEvent::TouchStart);
- if (content::IsThreadedCompositingEnabled()) {
- EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS,
- filter()->last_ack_state());
- } else {
- // http://crbug.com/326232: This should be NO_CONSUMER_EXISTS once
- // WebViewImpl::hasTouchEventHandlersAt() is implemented.
- EXPECT_EQ(INPUT_EVENT_ACK_STATE_NOT_CONSUMED, filter()->last_ack_state());
- }
+ EXPECT_EQ(INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS,
+ filter()->last_ack_state());
touch.PressPoint(25, 125);
GetWidgetHost()->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 51e1a68..61fb09e8 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1003,9 +1003,6 @@
if (IsPinchVirtualViewportEnabled())
command_line->AppendSwitch(cc::switches::kEnablePinchVirtualViewport);
- if (IsThreadedCompositingEnabled())
- command_line->AppendSwitch(switches::kEnableThreadedCompositing);
-
if (IsDelegatedRendererEnabled())
command_line->AppendSwitch(switches::kEnableDelegatedRenderer);
@@ -1107,6 +1104,7 @@
switches::kDisableSeccompFilterSandbox,
switches::kDisableSessionStorage,
switches::kDisableSharedWorkers,
+ switches::kDisableThreadedCompositing,
switches::kDisableTouchAdjustment,
switches::kDisableTouchDragDrop,
switches::kDisableTouchEditing,
@@ -1148,11 +1146,11 @@
switches::kEnableStatsTable,
switches::kEnableStrictSiteIsolation,
switches::kEnableTargetedStyleRecalc,
+ switches::kEnableThreadedCompositing,
switches::kEnableTouchDragDrop,
switches::kEnableTouchEditing,
switches::kEnableViewport,
switches::kEnableViewportMeta,
- switches::kMainFrameResizesAreOrientationChanges,
switches::kEnableVtune,
switches::kEnableWebAnimationsSVG,
switches::kEnableWebGLDraftExtensions,
@@ -1165,6 +1163,7 @@
switches::kIPCConnectionTimeout,
switches::kJavaScriptFlags,
switches::kLoggingLevel,
+ switches::kMainFrameResizesAreOrientationChanges,
switches::kMaxUntiledLayerWidth,
switches::kMaxUntiledLayerHeight,
switches::kMemoryMetrics,
diff --git a/content/browser/resources/gpu/info_view.js b/content/browser/resources/gpu/info_view.js
index 2dbe5a1..39042ca 100644
--- a/content/browser/resources/gpu/info_view.js
+++ b/content/browser/resources/gpu/info_view.js
@@ -101,10 +101,6 @@
'label': 'Software only. Hardware acceleration disabled',
'class': 'feature-yellow'
},
- 'disabled_software_threaded': {
- 'label': 'Software only, threaded. Hardware acceleration disabled',
- 'class': 'feature-yellow'
- },
'disabled_off': {
'label': 'Disabled',
'class': 'feature-red'
@@ -117,10 +113,6 @@
'label': 'Software only, hardware acceleration unavailable',
'class': 'feature-yellow'
},
- 'unavailable_software_threaded': {
- 'label': 'Software only, threaded. Hardware acceleration unavailable',
- 'class': 'feature-yellow'
- },
'unavailable_off': {
'label': 'Unavailable',
'class': 'feature-red'
@@ -137,10 +129,6 @@
'label': 'Hardware accelerated on all pages',
'class': 'feature-green'
},
- 'enabled_threaded': {
- 'label': 'Hardware accelerated and threaded',
- 'class': 'feature-green'
- },
'enabled': {
'label': 'Hardware accelerated',
'class': 'feature-green'
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index b415e3b..c78a95b5e 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -479,8 +479,8 @@
// SYN packet.
const char kEnableTcpFastOpen[] = "enable-tcp-fastopen";
-// Enable multithreaded GPU compositing of web content.
-const char kEnableThreadedCompositing[] = "enable-threaded-compositing";
+// Enabled threaded compositing for layout tests.
+const char kEnableThreadedCompositing[] = "enable-threaded-compositing";
// Enable screen capturing support for MediaStream API.
const char kEnableUserMediaScreenCapturing[] =
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 00d15280..952c7d75 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -818,7 +818,7 @@
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing);
+ bool enable = !command_line.HasSwitch(switches::kDisableThreadedCompositing);
if (enable) {
#if defined(OS_ANDROID)
if (SynchronousCompositorFactory* factory =
diff --git a/content/renderer/render_thread_impl_browsertest.cc b/content/renderer/render_thread_impl_browsertest.cc
index 11d486e..f5a0d1d 100644
--- a/content/renderer/render_thread_impl_browsertest.cc
+++ b/content/renderer/render_thread_impl_browsertest.cc
@@ -43,9 +43,6 @@
#endif
TEST_F(RenderThreadImplBrowserTest,
MAYBE_InputHandlerManagerDestroyedAfterCompositorThread) {
- CommandLine::ForCurrentProcess()->AppendSwitch(
- switches::kEnableThreadedCompositing);
-
ContentClient content_client;
ContentBrowserClient content_browser_client;
ContentRendererClient content_renderer_client;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 73ab008..85e4286 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -149,6 +149,11 @@
return it->second;
}
+bool IsThreadedCompositingEnabled() {
+ content::RenderThreadImpl* impl = content::RenderThreadImpl::current();
+ return impl && !!impl->compositor_message_loop_proxy().get();
+}
+
// TODO(brianderson): Replace the hard-coded threshold with a fraction of
// the BeginMainFrame interval.
// 4166us will allow 1/4 of a 60Hz interval or 1/2 of a 120Hz interval to
@@ -396,7 +401,6 @@
suppress_next_char_events_(false),
screen_info_(screen_info),
device_scale_factor_(screen_info_.deviceScaleFactor),
- is_threaded_compositing_enabled_(false),
current_event_latency_info_(NULL),
next_output_surface_id_(0),
#if defined(OS_ANDROID)
@@ -410,9 +414,6 @@
if (!swapped_out)
RenderProcess::current()->AddRefProcess();
DCHECK(RenderThread::Get());
- is_threaded_compositing_enabled_ =
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableThreadedCompositing);
device_color_profile_.push_back('0');
}
@@ -840,7 +841,7 @@
uint32 output_surface_id = next_output_surface_id_++;
if (command_line.HasSwitch(switches::kEnableDelegatedRenderer)) {
- DCHECK(is_threaded_compositing_enabled_);
+ DCHECK(IsThreadedCompositingEnabled());
return scoped_ptr<cc::OutputSurface>(
new DelegatedCompositorOutputSurface(
routing_id(),
@@ -863,7 +864,7 @@
// Composite-to-mailbox is currently used for layout tests in order to cause
// them to draw inside in the renderer to do the readback there. This should
// no longer be the case when crbug.com/311404 is fixed.
- DCHECK(is_threaded_compositing_enabled_ ||
+ DCHECK(IsThreadedCompositingEnabled() ||
RenderThreadImpl::current()->layout_test_mode());
cc::ResourceFormat format = cc::RGBA_8888;
if (base::SysInfo::IsLowEndDevice())
@@ -1172,8 +1173,8 @@
}
void RenderWidget::initializeLayerTreeView() {
- compositor_ = RenderWidgetCompositor::Create(
- this, is_threaded_compositing_enabled_);
+ compositor_ =
+ RenderWidgetCompositor::Create(this, IsThreadedCompositingEnabled());
compositor_->setViewportSize(size_, physical_backing_size_);
if (init_complete_)
StartCompositor();
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 3084e92..97fbb8d4 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -660,9 +660,6 @@
std::queue<SyntheticGestureCompletionCallback>
pending_synthetic_gesture_callbacks_;
- // Specified whether the compositor will run in its own thread.
- bool is_threaded_compositing_enabled_;
-
const ui::LatencyInfo* current_event_latency_info_;
uint32 next_output_surface_id_;
diff --git a/content/shell/app/shell_main_delegate.cc b/content/shell/app/shell_main_delegate.cc
index a8a6a22d..b532bf00 100644
--- a/content/shell/app/shell_main_delegate.cc
+++ b/content/shell/app/shell_main_delegate.cc
@@ -156,6 +156,7 @@
if (!command_line.HasSwitch(switches::kEnableThreadedCompositing)) {
command_line.AppendSwitch(switches::kDisableThreadedCompositing);
command_line.AppendSwitch(cc::switches::kDisableThreadedAnimation);
+ command_line.AppendSwitch(switches::kDisableImplSidePainting);
}
command_line.AppendSwitch(switches::kEnableInbandTextTracks);
diff --git a/content/shell/browser/shell_android.cc b/content/shell/browser/shell_android.cc
index 4033b47..5ed03cd 100644
--- a/content/shell/browser/shell_android.cc
+++ b/content/shell/browser/shell_android.cc
@@ -21,8 +21,6 @@
namespace content {
void Shell::PlatformInitialize(const gfx::Size& default_window_size) {
- CommandLine* command_line = CommandLine::ForCurrentProcess();
- DCHECK(command_line->HasSwitch(switches::kEnableThreadedCompositing));
}
void Shell::PlatformExit() {