Commit fc2f116c authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

[BlinkGenPropertyTrees] Use blink feature instead of layer list flag

This patch makes the renderer's compositor use blink runtime feature
flags to initialize the layer list setting. With this change we no
longer need to separately plumb both a blink feature (i.e., BGPT or
SPV2) and a layer list setting. This prevents the confusion situation of
having the blink feature flags not match the compositor's layer list
setting. This also simplifies the release of Blink Generated Property
Trees because we can use the existing processes for transitioning a
blink feature from test to experimental to stable.

The primary code change is to remove the --enable-layer-lists flag and
instead have render_widget.cc initialize the use_layer_lists setting
from blink feature flags. This patch also cleans up some plumbing for
the --enable-slimming-paint-v2 flag and adds TODOs to remove both
--enable-slimming-paint-v2 and --enable-blink-gen-property-trees.

Bug: 836884
Cq-Include-Trybots: luci.chromium.try:linux-blink-gen-property-trees;luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iffdefc896abb00e6692a0d77b4fde5f628cb8ff5
Reviewed-on: https://chromium-review.googlesource.com/c/1278988Reviewed-by: default avatarenne <enne@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600486}
parent b799c066
...@@ -84,8 +84,7 @@ const char kUIShowSurfaceDamageRects[] = "ui-show-surface-damage-rects"; ...@@ -84,8 +84,7 @@ const char kUIShowSurfaceDamageRects[] = "ui-show-surface-damage-rects";
const char kShowScreenSpaceRects[] = "show-screenspace-rects"; const char kShowScreenSpaceRects[] = "show-screenspace-rects";
const char kUIShowScreenSpaceRects[] = "ui-show-screenspace-rects"; const char kUIShowScreenSpaceRects[] = "ui-show-screenspace-rects";
// Switches cc machinery to use layer lists instead of layer trees // Switches the ui compositor to use layer lists instead of layer trees.
const char kEnableLayerLists[] = "enable-layer-lists";
const char kUIEnableLayerLists[] = "ui-enable-layer-lists"; const char kUIEnableLayerLists[] = "ui-enable-layer-lists";
// Prevents the layer tree unit tests from timing out. // Prevents the layer tree unit tests from timing out.
......
...@@ -44,7 +44,6 @@ CC_BASE_EXPORT extern const char kShowSurfaceDamageRects[]; ...@@ -44,7 +44,6 @@ CC_BASE_EXPORT extern const char kShowSurfaceDamageRects[];
CC_BASE_EXPORT extern const char kUIShowSurfaceDamageRects[]; CC_BASE_EXPORT extern const char kUIShowSurfaceDamageRects[];
CC_BASE_EXPORT extern const char kShowScreenSpaceRects[]; CC_BASE_EXPORT extern const char kShowScreenSpaceRects[];
CC_BASE_EXPORT extern const char kUIShowScreenSpaceRects[]; CC_BASE_EXPORT extern const char kUIShowScreenSpaceRects[];
CC_BASE_EXPORT extern const char kEnableLayerLists[];
CC_BASE_EXPORT extern const char kUIEnableLayerLists[]; CC_BASE_EXPORT extern const char kUIEnableLayerLists[];
CC_BASE_EXPORT extern const char kCompositedRenderPassBorders[]; CC_BASE_EXPORT extern const char kCompositedRenderPassBorders[];
CC_BASE_EXPORT extern const char kCompositedSurfaceBorders[]; CC_BASE_EXPORT extern const char kCompositedSurfaceBorders[];
......
...@@ -185,7 +185,6 @@ void DeriveCommandLine(const GURL& start_url, ...@@ -185,7 +185,6 @@ void DeriveCommandLine(const GURL& start_url,
cc::switches::kDisableMainFrameBeforeActivation, cc::switches::kDisableMainFrameBeforeActivation,
cc::switches::kDisableThreadedAnimation, cc::switches::kDisableThreadedAnimation,
cc::switches::kEnableGpuBenchmarking, cc::switches::kEnableGpuBenchmarking,
cc::switches::kEnableLayerLists,
cc::switches::kEnableMainFrameBeforeActivation, cc::switches::kEnableMainFrameBeforeActivation,
cc::switches::kShowCompositedLayerBorders, cc::switches::kShowCompositedLayerBorders,
cc::switches::kShowFPSCounter, cc::switches::kShowFPSCounter,
......
...@@ -2889,14 +2889,6 @@ static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) { ...@@ -2889,14 +2889,6 @@ static void AppendCompositorCommandLineFlags(base::CommandLine* command_line) {
if (IsMainFrameBeforeActivationEnabled()) if (IsMainFrameBeforeActivationEnabled())
command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation); command_line->AppendSwitch(cc::switches::kEnableMainFrameBeforeActivation);
// Slimming Paint v2 implies layer lists in the renderer.
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableSlimmingPaintV2) ||
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableBlinkGenPropertyTrees)) {
command_line->AppendSwitch(cc::switches::kEnableLayerLists);
}
} }
void RenderProcessHostImpl::AppendRendererCommandLine( void RenderProcessHostImpl::AppendRendererCommandLine(
...@@ -3091,7 +3083,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( ...@@ -3091,7 +3083,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
cc::switches::kDisableCompositedAntialiasing, cc::switches::kDisableCompositedAntialiasing,
cc::switches::kDisableThreadedAnimation, cc::switches::kDisableThreadedAnimation,
cc::switches::kEnableGpuBenchmarking, cc::switches::kEnableGpuBenchmarking,
cc::switches::kEnableLayerLists,
cc::switches::kShowCompositedLayerBorders, cc::switches::kShowCompositedLayerBorders,
cc::switches::kShowFPSCounter, cc::switches::kShowFPSCounter,
cc::switches::kShowLayerAnimationBounds, cc::switches::kShowLayerAnimationBounds,
......
...@@ -255,8 +255,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( ...@@ -255,8 +255,9 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
"BlinkGenPropertyTrees", "BlinkGenPropertyTrees",
command_line.HasSwitch(switches::kEnableBlinkGenPropertyTrees)); command_line.HasSwitch(switches::kEnableBlinkGenPropertyTrees));
if (command_line.HasSwitch(switches::kEnableSlimmingPaintV2)) WebRuntimeFeatures::EnableFeatureFromString(
WebRuntimeFeatures::EnableSlimmingPaintV2(true); "SlimmingPaintV2",
command_line.HasSwitch(switches::kEnableSlimmingPaintV2));
WebRuntimeFeatures::EnablePassiveDocumentEventListeners( WebRuntimeFeatures::EnablePassiveDocumentEventListeners(
base::FeatureList::IsEnabled(features::kPassiveDocumentEventListeners)); base::FeatureList::IsEnabled(features::kPassiveDocumentEventListeners));
......
...@@ -324,8 +324,8 @@ const char kEnablePreferCompositingToLCDText[] = ...@@ -324,8 +324,8 @@ const char kEnablePreferCompositingToLCDText[] =
// features. // features.
const char kEnableBlinkFeatures[] = "enable-blink-features"; const char kEnableBlinkFeatures[] = "enable-blink-features";
// A shorthand for adding both "--enable-blink-features=BlinkGenPropertyTrees" // This is now an alias of "--enable-blink-features=BlinkGenPropertyTrees".
// and "--enable-layer-lists". // TODO(pdr): This flag is redundant and should be removed.
const char kEnableBlinkGenPropertyTrees[] = "enable-blink-gen-property-trees"; const char kEnableBlinkGenPropertyTrees[] = "enable-blink-gen-property-trees";
// Enables Web Platform features that are in development. // Enables Web Platform features that are in development.
...@@ -392,6 +392,8 @@ const char kEnableServiceBinaryLauncher[] = "enable-service-binary-launcher"; ...@@ -392,6 +392,8 @@ const char kEnableServiceBinaryLauncher[] = "enable-service-binary-launcher";
const char kEnableSkiaBenchmarking[] = "enable-skia-benchmarking"; const char kEnableSkiaBenchmarking[] = "enable-skia-benchmarking";
// Enables slimming paint phase 2: https://www.chromium.org/blink/slimming-paint // Enables slimming paint phase 2: https://www.chromium.org/blink/slimming-paint
// This is now an alias of "--enable-blink-features=SlimmingPaintV2".
// TODO(pdr): This flag is redundant should be removed.
const char kEnableSlimmingPaintV2[] = "enable-slimming-paint-v2"; const char kEnableSlimmingPaintV2[] = "enable-slimming-paint-v2";
// On platforms that support it, enables smooth scroll animation. // On platforms that support it, enables smooth scroll animation.
......
...@@ -2621,7 +2621,11 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings( ...@@ -2621,7 +2621,11 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(
settings.top_controls_hide_threshold = hide_threshold; settings.top_controls_hide_threshold = hide_threshold;
} }
settings.use_layer_lists = cmd.HasSwitch(cc::switches::kEnableLayerLists); // Blink sends cc a layer list and property trees when either Blink Gen
// Property Trees or Slimming Paint V2 are enabled.
settings.use_layer_lists =
blink::WebRuntimeFeatures::IsBlinkGenPropertyTreesEnabled() ||
blink::WebRuntimeFeatures::IsSlimmingPaintV2Enabled();
// The means the renderer compositor has 2 possible modes: // The means the renderer compositor has 2 possible modes:
// - Threaded compositing with a scheduler. // - Threaded compositing with a scheduler.
......
...@@ -62,6 +62,8 @@ class WebRuntimeFeatures { ...@@ -62,6 +62,8 @@ class WebRuntimeFeatures {
const std::string& name, const std::string& name,
bool enable); bool enable);
BLINK_PLATFORM_EXPORT static bool IsBlinkGenPropertyTreesEnabled();
BLINK_PLATFORM_EXPORT static void EnableCompositedSelectionUpdate(bool); BLINK_PLATFORM_EXPORT static void EnableCompositedSelectionUpdate(bool);
BLINK_PLATFORM_EXPORT static bool IsCompositedSelectionUpdateEnabled(); BLINK_PLATFORM_EXPORT static bool IsCompositedSelectionUpdateEnabled();
...@@ -70,6 +72,8 @@ class WebRuntimeFeatures { ...@@ -70,6 +72,8 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableOriginTrials(bool); BLINK_PLATFORM_EXPORT static void EnableOriginTrials(bool);
BLINK_PLATFORM_EXPORT static bool IsOriginTrialsEnabled(); BLINK_PLATFORM_EXPORT static bool IsOriginTrialsEnabled();
BLINK_PLATFORM_EXPORT static bool IsSlimmingPaintV2Enabled();
BLINK_PLATFORM_EXPORT static void EnableAccelerated2dCanvas(bool); BLINK_PLATFORM_EXPORT static void EnableAccelerated2dCanvas(bool);
BLINK_PLATFORM_EXPORT static void EnableAccessibilityObjectModel(bool); BLINK_PLATFORM_EXPORT static void EnableAccessibilityObjectModel(bool);
BLINK_PLATFORM_EXPORT static void EnableAdTagging(bool); BLINK_PLATFORM_EXPORT static void EnableAdTagging(bool);
...@@ -150,7 +154,6 @@ class WebRuntimeFeatures { ...@@ -150,7 +154,6 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableSharedArrayBuffer(bool); BLINK_PLATFORM_EXPORT static void EnableSharedArrayBuffer(bool);
BLINK_PLATFORM_EXPORT static void EnableSharedWorker(bool); BLINK_PLATFORM_EXPORT static void EnableSharedWorker(bool);
BLINK_PLATFORM_EXPORT static void EnableSignedHTTPExchange(bool); BLINK_PLATFORM_EXPORT static void EnableSignedHTTPExchange(bool);
BLINK_PLATFORM_EXPORT static void EnableSlimmingPaintV2(bool);
BLINK_PLATFORM_EXPORT static void EnableTouchEventFeatureDetection(bool); BLINK_PLATFORM_EXPORT static void EnableTouchEventFeatureDetection(bool);
BLINK_PLATFORM_EXPORT static void EnableUserActivationV2(bool); BLINK_PLATFORM_EXPORT static void EnableUserActivationV2(bool);
BLINK_PLATFORM_EXPORT static void EnableV8IdleTasks(bool); BLINK_PLATFORM_EXPORT static void EnableV8IdleTasks(bool);
......
...@@ -64,6 +64,10 @@ void WebRuntimeFeatures::EnableFeatureFromString(const std::string& name, ...@@ -64,6 +64,10 @@ void WebRuntimeFeatures::EnableFeatureFromString(const std::string& name,
RuntimeEnabledFeatures::SetFeatureEnabledFromString(name, enable); RuntimeEnabledFeatures::SetFeatureEnabledFromString(name, enable);
} }
bool WebRuntimeFeatures::IsBlinkGenPropertyTreesEnabled() {
return RuntimeEnabledFeatures::BlinkGenPropertyTreesEnabled();
}
void WebRuntimeFeatures::EnableTestOnlyFeatures(bool enable) { void WebRuntimeFeatures::EnableTestOnlyFeatures(bool enable) {
RuntimeEnabledFeatures::SetTestFeaturesEnabled(enable); RuntimeEnabledFeatures::SetTestFeaturesEnabled(enable);
} }
...@@ -332,8 +336,8 @@ void WebRuntimeFeatures::EnableScriptedSpeech(bool enable) { ...@@ -332,8 +336,8 @@ void WebRuntimeFeatures::EnableScriptedSpeech(bool enable) {
RuntimeEnabledFeatures::SetScriptedSpeechEnabled(enable); RuntimeEnabledFeatures::SetScriptedSpeechEnabled(enable);
} }
void WebRuntimeFeatures::EnableSlimmingPaintV2(bool enable) { bool WebRuntimeFeatures::IsSlimmingPaintV2Enabled() {
RuntimeEnabledFeatures::SetSlimmingPaintV2Enabled(enable); return RuntimeEnabledFeatures::SlimmingPaintV2Enabled();
} }
void WebRuntimeFeatures::EnableUserActivationV2(bool enable) { void WebRuntimeFeatures::EnableUserActivationV2(bool enable) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment