Commit 159e26f3 authored by Steve Kobes's avatar Steve Kobes Committed by Commit Bot

Remove JankTrackingSweepLine REF.

Bug: 1000716
Change-Id: Iee211fd0cdb5466fcdaf308a48031f039aaf8258
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792581Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695043}
parent 01b8f477
...@@ -108,7 +108,6 @@ class WebRuntimeFeatures { ...@@ -108,7 +108,6 @@ class WebRuntimeFeatures {
BLINK_PLATFORM_EXPORT static void EnableGenericSensorExtraClasses(bool); BLINK_PLATFORM_EXPORT static void EnableGenericSensorExtraClasses(bool);
BLINK_PLATFORM_EXPORT static void EnableImplicitRootScroller(bool); BLINK_PLATFORM_EXPORT static void EnableImplicitRootScroller(bool);
BLINK_PLATFORM_EXPORT static void EnableInputMultipleFieldsUI(bool); BLINK_PLATFORM_EXPORT static void EnableInputMultipleFieldsUI(bool);
BLINK_PLATFORM_EXPORT static void EnableJankTrackingSweepLine(bool);
BLINK_PLATFORM_EXPORT static void EnableBuiltInModuleAll(bool); BLINK_PLATFORM_EXPORT static void EnableBuiltInModuleAll(bool);
BLINK_PLATFORM_EXPORT static void EnableBuiltInModuleInfra(bool); BLINK_PLATFORM_EXPORT static void EnableBuiltInModuleInfra(bool);
BLINK_PLATFORM_EXPORT static void EnableBuiltInModuleKvStorage(bool); BLINK_PLATFORM_EXPORT static void EnableBuiltInModuleKvStorage(bool);
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
namespace blink { namespace blink {
// Represents a per-frame layout shift region for LayoutShiftTracker. Only used // Represents a per-frame layout shift region for LayoutShiftTracker.
// when the JankTrackingSweepLine feature is enabled.
// //
// This class uses a sweep line algorithm to compute the area in O(n log n) time // This class uses a sweep line algorithm to compute the area in O(n log n) time
// where n is the number of rects recorded by AddRect. For complex layout shift // where n is the number of rects recorded by AddRect. For complex layout shift
......
...@@ -28,8 +28,7 @@ namespace blink { ...@@ -28,8 +28,7 @@ namespace blink {
static constexpr base::TimeDelta kTimerDelay = static constexpr base::TimeDelta kTimerDelay =
base::TimeDelta::FromMilliseconds(500); base::TimeDelta::FromMilliseconds(500);
static const float kRegionGranularitySteps = 60.0; // TODO(crbug.com/1000716): Remove granularity scaling logic.
// TODO: Vary by Finch experiment parameter.
static const float kSweepLineRegionGranularity = 1.0; static const float kSweepLineRegionGranularity = 1.0;
static const float kMovementThreshold = 3.0; // CSS pixels. static const float kMovementThreshold = 3.0; // CSS pixels.
...@@ -53,11 +52,7 @@ static float GetMoveDistance(const FloatRect& old_rect, ...@@ -53,11 +52,7 @@ static float GetMoveDistance(const FloatRect& old_rect,
float LayoutShiftTracker::RegionGranularityScale( float LayoutShiftTracker::RegionGranularityScale(
const IntRect& viewport) const { const IntRect& viewport) const {
if (RuntimeEnabledFeatures::JankTrackingSweepLineEnabled()) return kSweepLineRegionGranularity;
return kSweepLineRegionGranularity;
return kRegionGranularitySteps /
std::min(viewport.Height(), viewport.Width());
} }
static bool EqualWithinMovementThreshold(const FloatPoint& a, static bool EqualWithinMovementThreshold(const FloatPoint& a,
...@@ -220,13 +215,9 @@ void LayoutShiftTracker::ObjectShifted( ...@@ -220,13 +215,9 @@ void LayoutShiftTracker::ObjectShifted(
visible_old_rect.Scale(scale); visible_old_rect.Scale(scale);
visible_new_rect.Scale(scale); visible_new_rect.Scale(scale);
if (RuntimeEnabledFeatures::JankTrackingSweepLineEnabled()) { // TODO(crbug.com/1000716): Rename region_experimental_.
region_experimental_.AddRect(visible_old_rect); region_experimental_.AddRect(visible_old_rect);
region_experimental_.AddRect(visible_new_rect); region_experimental_.AddRect(visible_new_rect);
} else {
region_.Unite(Region(visible_old_rect));
region_.Unite(Region(visible_new_rect));
}
} }
void LayoutShiftTracker::NotifyObjectPrePaint( void LayoutShiftTracker::NotifyObjectPrePaint(
...@@ -269,7 +260,7 @@ double LayoutShiftTracker::SubframeWeightingFactor() const { ...@@ -269,7 +260,7 @@ double LayoutShiftTracker::SubframeWeightingFactor() const {
void LayoutShiftTracker::NotifyPrePaintFinished() { void LayoutShiftTracker::NotifyPrePaintFinished() {
if (!IsActive()) if (!IsActive())
return; return;
bool use_sweep_line = RuntimeEnabledFeatures::JankTrackingSweepLineEnabled(); bool use_sweep_line = true;
bool region_is_empty = bool region_is_empty =
use_sweep_line ? region_experimental_.IsEmpty() : region_.IsEmpty(); use_sweep_line ? region_experimental_.IsEmpty() : region_.IsEmpty();
if (region_is_empty) if (region_is_empty)
...@@ -459,10 +450,8 @@ std::unique_ptr<TracedValue> LayoutShiftTracker::PerFrameTraceData( ...@@ -459,10 +450,8 @@ std::unique_ptr<TracedValue> LayoutShiftTracker::PerFrameTraceData(
float granularity_scale = RegionGranularityScale( float granularity_scale = RegionGranularityScale(
IntRect(IntPoint(), IntRect(IntPoint(),
frame_view_->GetScrollableArea()->VisibleContentRect().Size())); frame_view_->GetScrollableArea()->VisibleContentRect().Size()));
if (RuntimeEnabledFeatures::JankTrackingSweepLineEnabled())
RegionToTracedValue(region_experimental_, granularity_scale, *value); RegionToTracedValue(region_experimental_, granularity_scale, *value);
else
RegionToTracedValue(region_, granularity_scale, *value);
value->SetBoolean("is_main_frame", frame_view_->GetFrame().IsMainFrame()); value->SetBoolean("is_main_frame", frame_view_->GetFrame().IsMainFrame());
value->SetBoolean("had_recent_input", input_detected); value->SetBoolean("had_recent_input", input_detected);
......
...@@ -60,23 +60,6 @@ TEST_F(LayoutShiftTrackerTest, SimpleBlockMovement) { ...@@ -60,23 +60,6 @@ TEST_F(LayoutShiftTrackerTest, SimpleBlockMovement) {
EXPECT_FLOAT_EQ(60.0, GetLayoutShiftTracker().OverallMaxDistance()); EXPECT_FLOAT_EQ(60.0, GetLayoutShiftTracker().OverallMaxDistance());
} }
TEST_F(LayoutShiftTrackerTest, GranularitySnapping) {
if (RuntimeEnabledFeatures::JankTrackingSweepLineEnabled())
return;
SetBodyInnerHTML(R"HTML(
<style>
#j { position: relative; width: 304px; height: 104px; }
</style>
<div id='j'></div>
)HTML");
GetDocument().getElementById("j")->setAttribute(html_names::kStyleAttr,
AtomicString("top: 58px"));
UpdateAllLifecyclePhases();
// Rect locations and sizes should snap to multiples of 600 / 60 = 10.
EXPECT_FLOAT_EQ(0.1, GetLayoutShiftTracker().Score());
}
TEST_F(LayoutShiftTrackerTest, Transform) { TEST_F(LayoutShiftTrackerTest, Transform) {
SetBodyInnerHTML(R"HTML( SetBodyInnerHTML(R"HTML(
<style> <style>
......
...@@ -220,10 +220,6 @@ void WebRuntimeFeatures::EnableInputMultipleFieldsUI(bool enable) { ...@@ -220,10 +220,6 @@ void WebRuntimeFeatures::EnableInputMultipleFieldsUI(bool enable) {
RuntimeEnabledFeatures::SetInputMultipleFieldsUIEnabled(enable); RuntimeEnabledFeatures::SetInputMultipleFieldsUIEnabled(enable);
} }
void WebRuntimeFeatures::EnableJankTrackingSweepLine(bool enable) {
RuntimeEnabledFeatures::SetJankTrackingSweepLineEnabled(enable);
}
void WebRuntimeFeatures::EnableBuiltInModuleAll(bool enable) { void WebRuntimeFeatures::EnableBuiltInModuleAll(bool enable) {
RuntimeEnabledFeatures::SetBuiltInModuleAllEnabled(enable); RuntimeEnabledFeatures::SetBuiltInModuleAllEnabled(enable);
} }
......
...@@ -833,12 +833,6 @@ ...@@ -833,12 +833,6 @@
// world. See crbug.com/896041. // world. See crbug.com/896041.
name: "IsolatedWorldCSP" name: "IsolatedWorldCSP"
}, },
{
// Modifies LayoutShiftTracker to use O(n log n) sweep line algorithm for
// computing the area of the layout shift region.
name: "JankTrackingSweepLine",
status: "stable",
},
{ {
name: "JSONModules", name: "JSONModules",
}, },
......
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