Commit ed4fd174 authored by Steve Kobes's avatar Steve Kobes Committed by Commit Bot

Revert "Add sweep_line_region_granularity Finch param."

This reverts commit de838847.

Reason for revert: Given current Finch data (go/janktrackingsweepline),
we have decided to launch JankTrackingSweepLine without running the
previously proposed granularity experiment.

Original change's description:
> Add sweep_line_region_granularity Finch param.
> 
> This controls the degree of region granularity snapping that occurs in
> JankTracker when the sweep line algorithm (JankTrackingSweepLine) is
> enabled.  Previously, the sweep line feature disabled all granularity
> snapping.
> 
> The default param setting, kHigh, matches the degree of granularity
> snapping that is performed without the sweep line algorithm.
> 
> Bug: 581518
> Change-Id: I75a5264b9625349572e6a7f8a7249852e2a8304a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1655984
> Commit-Queue: Steve Kobes <skobes@chromium.org>
> Reviewed-by: Timothy Dresser <tdresser@chromium.org>
> Reviewed-by: Emily Hanley <eyaich@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#668556}

TBR=skobes@chromium.org,tdresser@chromium.org,eyaich@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 581518
Change-Id: Iba95a93d2bc5f0e15495db3e647b0090ef85c680
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1661474Reviewed-by: default avatarSteve Kobes <skobes@chromium.org>
Commit-Queue: Steve Kobes <skobes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669665}
parent 7a66f3b5
...@@ -4,10 +4,8 @@ ...@@ -4,10 +4,8 @@
#include "third_party/blink/renderer/core/layout/jank_tracker.h" #include "third_party/blink/renderer/core/layout/jank_tracker.h"
#include "base/metrics/field_trial_params.h"
#include "cc/layers/heads_up_display_layer.h" #include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/picture_layer.h" #include "cc/layers/picture_layer.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h" #include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h" #include "third_party/blink/renderer/core/frame/local_frame_client.h"
...@@ -28,11 +26,11 @@ ...@@ -28,11 +26,11 @@
namespace blink { namespace blink {
static constexpr TimeDelta kTimerDelay = TimeDelta::FromMilliseconds(500); static constexpr TimeDelta kTimerDelay = TimeDelta::FromMilliseconds(500);
static const float kRegionGranularitySteps = 60.0;
// TODO: Vary by Finch experiment parameter.
static const float kSweepLineRegionGranularity = 1.0;
static const float kMovementThreshold = 3.0; // CSS pixels. static const float kMovementThreshold = 3.0; // CSS pixels.
// Level of granularity snapping for impact region (see RegionGranularityScale).
enum GranularitySnapping { kPixel = 1, kLow = 2, kMedium = 3, kHigh = 4 };
static FloatPoint LogicalStart(const FloatRect& rect, static FloatPoint LogicalStart(const FloatRect& rect,
const LayoutObject& object) { const LayoutObject& object) {
const ComputedStyle* style = object.Style(); const ComputedStyle* style = object.Style();
...@@ -52,29 +50,11 @@ static float GetMoveDistance(const FloatRect& old_rect, ...@@ -52,29 +50,11 @@ static float GetMoveDistance(const FloatRect& old_rect,
} }
static float RegionGranularityScale(const IntRect& viewport) { static float RegionGranularityScale(const IntRect& viewport) {
static const base::FeatureParam<int> kSweepLineRegionGranularity{ if (RuntimeEnabledFeatures::JankTrackingSweepLineEnabled())
&blink::features::kJankTrackingSweepLine, "sweep_line_region_granularity", return kSweepLineRegionGranularity;
kHigh};
return kRegionGranularitySteps /
GranularitySnapping snapping_type = std::min(viewport.Height(), viewport.Width());
RuntimeEnabledFeatures::JankTrackingSweepLineEnabled()
? (GranularitySnapping)kSweepLineRegionGranularity.Get()
: kHigh;
switch (snapping_type) {
case kPixel:
// Snap to multiples of 1px.
return 1.0;
case kLow:
// Snap to multiples of 2px.
return 1 / 2.0;
case kMedium:
// Snap to multiples of 5px.
return 1 / 5.0;
case kHigh:
// Snap to multiples of 1/60th of min(viewport width, viewport height).
return 60.0 / std::min(viewport.Height(), viewport.Width());
}
NOTREACHED();
} }
static bool EqualWithinMovementThreshold(const FloatPoint& a, static bool EqualWithinMovementThreshold(const FloatPoint& a,
......
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