Skip to content

Commit

Permalink
Fixed scroll focused smoothness metric
Browse files Browse the repository at this point in the history
The scroll focused smoothness metric would report smoothness as usual when no scrolling is active.

Bug: chromium:1278778
Change-Id: I0c19271df3e9095c19bb328ce9c48a5ab5ad3bf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3330481
Reviewed-by: Jonathan Ross <jonross@chromium.org>
Commit-Queue: Behdad Bakhshinategh <behdadb@chromium.org>
Cr-Commit-Position: refs/heads/main@{#950609}
  • Loading branch information
behdad authored and Chromium LUCI CQ committed Dec 10, 2021
1 parent 997e70d commit 6db4a1d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cc/metrics/dropped_frame_counter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ void DroppedFrameCounter::UpdateDroppedFrameCountInWindow(
dropped_frame_count_in_window_[SmoothnessStrategy::kMainFocusedStrategy] +=
count;
}
if (frame_info.WasScrollUpdateDropped()) {
if (frame_info.IsScrollPrioritizeFrameDropped()) {
DCHECK_GE(dropped_frame_count_in_window_
[SmoothnessStrategy::kScrollFocusedStrategy] +
count,
Expand Down
7 changes: 5 additions & 2 deletions cc/metrics/frame_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,17 @@ bool FrameInfo::WasMainUpdateDropped() const {
return false;
}

bool FrameInfo::WasScrollUpdateDropped() const {
bool FrameInfo::IsScrollPrioritizeFrameDropped() const {
// If any scroll is active the dropped frame for only the scrolling thread is
// reported. If no scroll is active then reports if dropped frames is
// affecting smoothness.
switch (scroll_thread) {
case SmoothEffectDrivingThread::kCompositor:
return WasCompositorUpdateDropped();
case SmoothEffectDrivingThread::kMain:
return WasMainUpdateDropped();
case SmoothEffectDrivingThread::kUnknown:
return false;
return IsDroppedAffectingSmoothness();
}
}

Expand Down
2 changes: 1 addition & 1 deletion cc/metrics/frame_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct CC_EXPORT FrameInfo {

bool WasCompositorUpdateDropped() const;
bool WasMainUpdateDropped() const;
bool WasScrollUpdateDropped() const;
bool IsScrollPrioritizeFrameDropped() const;

private:
bool was_merged = false;
Expand Down

0 comments on commit 6db4a1d

Please sign in to comment.