Commit bf1ce6b9 authored by Yi Gu's avatar Yi Gu Committed by Commit Bot

Remove the feature SkipCompositingSmallScrollers

We do not need the feature any more since the experiment of not
compositing small scrollers is done. See crbug.com/684631.

Bug: 775643
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I9f0d6c82ffd4d3813630b74ed20f4d44d7fd166f
Reviewed-on: https://chromium-review.googlesource.com/723982Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510102}
parent 10b4a6c8
...@@ -306,9 +306,6 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs( ...@@ -306,9 +306,6 @@ void SetRuntimeFeaturesDefaultsAndUpdateFromArgs(
if (base::FeatureList::IsEnabled(features::kCompositorTouchAction)) if (base::FeatureList::IsEnabled(features::kCompositorTouchAction))
WebRuntimeFeatures::EnableCompositorTouchAction(true); WebRuntimeFeatures::EnableCompositorTouchAction(true);
if (base::FeatureList::IsEnabled(features::kSkipCompositingSmallScrollers))
WebRuntimeFeatures::EnableSkipCompositingSmallScrollers(true);
if (base::FeatureList::IsEnabled(features::kGenericSensor)) { if (base::FeatureList::IsEnabled(features::kGenericSensor)) {
WebRuntimeFeatures::EnableGenericSensor(true); WebRuntimeFeatures::EnableGenericSensor(true);
if (base::FeatureList::IsEnabled(features::kGenericSensorExtraClasses)) if (base::FeatureList::IsEnabled(features::kGenericSensorExtraClasses))
......
...@@ -288,10 +288,6 @@ const base::Feature kSignInProcessIsolation{"sign-in-process-isolation", ...@@ -288,10 +288,6 @@ const base::Feature kSignInProcessIsolation{"sign-in-process-isolation",
const base::Feature kSitePerProcess{"site-per-process", const base::Feature kSitePerProcess{"site-per-process",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
// An experiment for skipping compositing small scrollers.
const base::Feature kSkipCompositingSmallScrollers{
"SkipCompositingSmallScrollers", base::FEATURE_DISABLED_BY_DEFAULT};
// Paint invalidation based on slimming paint. See https://goo.gl/eQczQW // Paint invalidation based on slimming paint. See https://goo.gl/eQczQW
const base::Feature kSlimmingPaintInvalidation{ const base::Feature kSlimmingPaintInvalidation{
"SlimmingPaintInvalidation", base::FEATURE_ENABLED_BY_DEFAULT}; "SlimmingPaintInvalidation", base::FEATURE_ENABLED_BY_DEFAULT};
......
...@@ -77,7 +77,6 @@ CONTENT_EXPORT extern const base::Feature kServiceWorkerPaymentApps; ...@@ -77,7 +77,6 @@ CONTENT_EXPORT extern const base::Feature kServiceWorkerPaymentApps;
CONTENT_EXPORT extern const base::Feature kServiceWorkerScriptStreaming; CONTENT_EXPORT extern const base::Feature kServiceWorkerScriptStreaming;
CONTENT_EXPORT extern const base::Feature kSignInProcessIsolation; CONTENT_EXPORT extern const base::Feature kSignInProcessIsolation;
CONTENT_EXPORT extern const base::Feature kSitePerProcess; CONTENT_EXPORT extern const base::Feature kSitePerProcess;
CONTENT_EXPORT extern const base::Feature kSkipCompositingSmallScrollers;
CONTENT_EXPORT extern const base::Feature kSlimmingPaintInvalidation; CONTENT_EXPORT extern const base::Feature kSlimmingPaintInvalidation;
CONTENT_EXPORT extern const base::Feature kTimerThrottlingForHiddenFrames; CONTENT_EXPORT extern const base::Feature kTimerThrottlingForHiddenFrames;
CONTENT_EXPORT extern const base::Feature kTopDocumentIsolation; CONTENT_EXPORT extern const base::Feature kTopDocumentIsolation;
......
...@@ -96,11 +96,6 @@ namespace { ...@@ -96,11 +96,6 @@ namespace {
// minimum size used by firefox is 15x15. // minimum size used by firefox is 15x15.
static const int kDefaultMinimumWidthForResizing = 15; static const int kDefaultMinimumWidthForResizing = 15;
static const int kDefaultMinimumHeightForResizing = 15; static const int kDefaultMinimumHeightForResizing = 15;
// By not compositing scrollers smaller than 160000px (400 * 400), on android
// devices we might affect roughly 90% scrollers for memory saving while at
// most 30% scrolls may be slowed down. On non-android devices, it affects
// roughly 50% scrollers and 13% scrolls.
static constexpr int kSmallScrollerThreshold = 160000;
} // namespace } // namespace
...@@ -1986,17 +1981,8 @@ bool PaintLayerScrollableArea::ComputeNeedsCompositedScrolling( ...@@ -1986,17 +1981,8 @@ bool PaintLayerScrollableArea::ComputeNeedsCompositedScrolling(
if (layer->Size().IsEmpty()) if (layer->Size().IsEmpty())
return false; return false;
// This is for an experiment aiming at memory save by not compositing certain
// scrollers. See http://crbug.com/746018, http://crbug.com/684631.
// TODO(yigu): Report this main thread scrolling reason once the patch is
// landed.
CheckedNumeric<int> size = VisibleContentRect().Width();
size *= VisibleContentRect().Height();
if (!layer_has_been_composited && if (!layer_has_been_composited &&
((RuntimeEnabledFeatures::SkipCompositingSmallScrollersEnabled() && !LayerNodeMayNeedCompositedScrolling(layer)) {
size.ValueOrDefault(std::numeric_limits<int>::max()) <
kSmallScrollerThreshold) ||
!LayerNodeMayNeedCompositedScrolling(layer))) {
return false; return false;
} }
......
...@@ -455,118 +455,6 @@ TEST_F(PaintLayerScrollableAreaTest, OnlyOpaqueLayersPromoted) { ...@@ -455,118 +455,6 @@ TEST_F(PaintLayerScrollableAreaTest, OnlyOpaqueLayersPromoted) {
EXPECT_FALSE(paint_layer->GraphicsLayerBacking()); EXPECT_FALSE(paint_layer->GraphicsLayerBacking());
} }
// Test that small scrollers (area < 160000px) don't get promoted.
TEST_F(PaintLayerScrollableAreaTest, SmallScrollerPromotionTest) {
GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled(
true);
ScopedSkipCompositingSmallScrollersForTest skip_compositing_small_scrollers(
true);
SetBodyInnerHTML(
"<!DOCTYPE html>"
"<style>"
" .smallBox { overflow: scroll; width: 100px; height: 100px; }"
" .spacer { height: 2000px; }"
"</style>"
"<div id='small' class='smallBox'><div class='spacer'></div></div>");
GetDocument().View()->UpdateAllLifecyclePhases();
EXPECT_TRUE(RuntimeEnabledFeatures::SkipCompositingSmallScrollersEnabled());
Element* small_scroller = GetDocument().getElementById("small");
PaintLayer* small_layer =
ToLayoutBoxModelObject(small_scroller->GetLayoutObject())->Layer();
ASSERT_TRUE(small_layer);
EXPECT_FALSE(small_layer->NeedsCompositedScrolling());
}
// Test that large scrollers get promoted with PreferCompositingToLCDEnabled or
// other compositing reasons like will-change:transform.
TEST_F(PaintLayerScrollableAreaTest, LargeScrollerPromotionTest) {
GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled(
false);
ScopedSkipCompositingSmallScrollersForTest skip_compositing_small_scrollers(
true);
SetBodyInnerHTML(
"<!DOCTYPE html>"
"<style>"
" .largeBox { overflow: scroll; width: 400px; height: 400px; }"
" .composited { will-change: transform; }"
" .spacer { height: 2000px; }"
"</style>"
"<div id='largeBox1' class='composited largeBox'>"
" <div class='spacer'></div>"
"</div>"
"<div id='largeBox2' class='largeBox'><div class='spacer'></div></div>");
GetDocument().View()->UpdateAllLifecyclePhases();
EXPECT_TRUE(RuntimeEnabledFeatures::SkipCompositingSmallScrollersEnabled());
Element* large_scroller = GetDocument().getElementById("largeBox1");
PaintLayer* large_layer =
ToLayoutBoxModelObject(large_scroller->GetLayoutObject())->Layer();
ASSERT_TRUE(large_layer);
EXPECT_TRUE(large_layer->NeedsCompositedScrolling());
large_scroller = GetDocument().getElementById("largeBox2");
large_layer =
ToLayoutBoxModelObject(large_scroller->GetLayoutObject())->Layer();
ASSERT_TRUE(large_layer);
EXPECT_FALSE(large_layer->NeedsCompositedScrolling());
GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled(
true);
GetDocument().View()->UpdateAllLifecyclePhases();
EXPECT_TRUE(large_layer->NeedsCompositedScrolling());
}
// Test that small scrollers with separate compositing reasons get promoted.
TEST_F(PaintLayerScrollableAreaTest,
SmallScrollerWithSeparateCompositingReasonPromotionTest) {
GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled(
true);
ScopedSkipCompositingSmallScrollersForTest skip_compositing_small_scrollers(
true);
SetBodyInnerHTML(
"<!DOCTYPE html>"
"<style>"
" .smallBox { overflow: scroll; width: 100px; height: 100px; }"
" .composited { backface-visibility: hidden; }"
" .composited2 { will-change: transform; }"
" .spacer { height: 2000px; }"
"</style>"
"<div id='box1' class='composited smallBox'>"
" <div class='spacer'></div>"
"</div>"
"<div id='box2' class='composited2 smallBox'>"
" <div class='spacer'></div>"
"</div>"
"<div class='composited smallBox'>"
" <div id='box3' style='opacity: 0.5;' class='smallBox'>"
" <div class='spacer'></div>"
" </div>"
" <div class='spacer'></div>"
"</div>");
GetDocument().View()->UpdateAllLifecyclePhases();
EXPECT_TRUE(RuntimeEnabledFeatures::SkipCompositingSmallScrollersEnabled());
Element* small_scroller = GetDocument().getElementById("box1");
PaintLayer* small_layer =
ToLayoutBoxModelObject(small_scroller->GetLayoutObject())->Layer();
ASSERT_TRUE(small_layer);
EXPECT_TRUE(small_layer->NeedsCompositedScrolling());
small_scroller = GetDocument().getElementById("box2");
small_layer =
ToLayoutBoxModelObject(small_scroller->GetLayoutObject())->Layer();
ASSERT_TRUE(small_layer);
EXPECT_TRUE(small_layer->NeedsCompositedScrolling());
small_scroller = GetDocument().getElementById("box3");
small_layer =
ToLayoutBoxModelObject(small_scroller->GetLayoutObject())->Layer();
ASSERT_TRUE(small_layer);
EXPECT_TRUE(small_layer->NeedsCompositedScrolling());
}
// Test that <input> elements get promoted with "will-change:transform". // Test that <input> elements get promoted with "will-change:transform".
TEST_F(PaintLayerScrollableAreaTest, InputElementPromotionTest) { TEST_F(PaintLayerScrollableAreaTest, InputElementPromotionTest) {
SetBodyInnerHTML( SetBodyInnerHTML(
......
...@@ -280,10 +280,6 @@ void WebRuntimeFeatures::EnableScriptedSpeech(bool enable) { ...@@ -280,10 +280,6 @@ void WebRuntimeFeatures::EnableScriptedSpeech(bool enable) {
RuntimeEnabledFeatures::SetScriptedSpeechEnabled(enable); RuntimeEnabledFeatures::SetScriptedSpeechEnabled(enable);
} }
void WebRuntimeFeatures::EnableSkipCompositingSmallScrollers(bool enable) {
RuntimeEnabledFeatures::SetSkipCompositingSmallScrollersEnabled(enable);
}
void WebRuntimeFeatures::EnableSlimmingPaintV2(bool enable) { void WebRuntimeFeatures::EnableSlimmingPaintV2(bool enable) {
RuntimeEnabledFeatures::SetSlimmingPaintV2Enabled(enable); RuntimeEnabledFeatures::SetSlimmingPaintV2Enabled(enable);
} }
......
...@@ -952,9 +952,6 @@ ...@@ -952,9 +952,6 @@
name: "SignatureBasedIntegrity", name: "SignatureBasedIntegrity",
status: "experimental", status: "experimental",
}, },
{
name: "SkipCompositingSmallScrollers",
},
{ {
name: "SlimmingPaintStrictCullRectClipping", name: "SlimmingPaintStrictCullRectClipping",
}, },
......
...@@ -68,10 +68,6 @@ typedef ScopedRuntimeEnabledFeatureForTest< ...@@ -68,10 +68,6 @@ typedef ScopedRuntimeEnabledFeatureForTest<
RuntimeEnabledFeatures::OverlayScrollbarsEnabled, RuntimeEnabledFeatures::OverlayScrollbarsEnabled,
RuntimeEnabledFeatures::SetOverlayScrollbarsEnabled> RuntimeEnabledFeatures::SetOverlayScrollbarsEnabled>
ScopedOverlayScrollbarsForTest; ScopedOverlayScrollbarsForTest;
typedef ScopedRuntimeEnabledFeatureForTest<
RuntimeEnabledFeatures::SkipCompositingSmallScrollersEnabled,
RuntimeEnabledFeatures::SetSkipCompositingSmallScrollersEnabled>
ScopedSkipCompositingSmallScrollersForTest;
typedef ScopedRuntimeEnabledFeatureForTest< typedef ScopedRuntimeEnabledFeatureForTest<
RuntimeEnabledFeatures::ExperimentalCanvasFeaturesEnabled, RuntimeEnabledFeatures::ExperimentalCanvasFeaturesEnabled,
RuntimeEnabledFeatures::SetExperimentalCanvasFeaturesEnabled> RuntimeEnabledFeatures::SetExperimentalCanvasFeaturesEnabled>
......
...@@ -134,7 +134,6 @@ class WebRuntimeFeatures { ...@@ -134,7 +134,6 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableServiceWorkerNavigationPreload(bool); BLINK_PLATFORM_EXPORT static void EnableServiceWorkerNavigationPreload(bool);
BLINK_PLATFORM_EXPORT static void EnableServiceWorkerScriptStreaming(bool); BLINK_PLATFORM_EXPORT static void EnableServiceWorkerScriptStreaming(bool);
BLINK_PLATFORM_EXPORT static void EnableSharedWorker(bool); BLINK_PLATFORM_EXPORT static void EnableSharedWorker(bool);
BLINK_PLATFORM_EXPORT static void EnableSkipCompositingSmallScrollers(bool);
BLINK_PLATFORM_EXPORT static void EnableSlimmingPaintV2(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 EnableTouchpadAndWheelScrollLatching(bool); BLINK_PLATFORM_EXPORT static void EnableTouchpadAndWheelScrollLatching(bool);
......
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