Commit 08e71a98 authored by yiyix's avatar yiyix Committed by Commit Bot

FrameMetrics: Track the skipped frame rate during scrolling event only

Skipped Frame tracker used to record every frame produced at all times.
With that approach, it's hard to study the correlation between the user
actions and the skipped frame rate. In this patch, we only track the
skipped frame rate during scrolling events. More user actions will be
added in the future cls.

Design doc on skipped frame tracker:
https://docs.google.com/document/d/1SqqdQsdh9CA5SRHCvkI_FDcc-vBW-saEj1kh4-qTBwg

Videos on how it used to work:
https://drive.google.com/open?id=1S5fnq8VrqvUIYFZjvIi4GNA3ekIdggG0

Bug: 894149

Change-Id: I02441cb5c9f551cc80b51ea1dcbafa3c492cb5ce
Reviewed-on: https://chromium-review.googlesource.com/c/1334103Reviewed-by: default avatardanakj <danakj@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Yi Xu <yiyix@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607861}
parent e2de0f9a
...@@ -3021,6 +3021,8 @@ void LayerTreeHostImpl::SetNeedsOneBeginImplFrame() { ...@@ -3021,6 +3021,8 @@ void LayerTreeHostImpl::SetNeedsOneBeginImplFrame() {
void LayerTreeHostImpl::SetNeedsRedraw() { void LayerTreeHostImpl::SetNeedsRedraw() {
NotifySwapPromiseMonitorsOfSetNeedsRedraw(); NotifySwapPromiseMonitorsOfSetNeedsRedraw();
client_->SetNeedsRedrawOnImplThread(); client_->SetNeedsRedrawOnImplThread();
if (CurrentlyScrollingNode())
skipped_frame_tracker_.WillProduceFrame();
} }
ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const { ManagedMemoryPolicy LayerTreeHostImpl::ActualManagedMemoryPolicy() const {
......
...@@ -394,5 +394,12 @@ TEST_F(SkippedFrameTrackerTest, NoSkips_ActiveIdleActive_FramePulledIsPush) { ...@@ -394,5 +394,12 @@ TEST_F(SkippedFrameTrackerTest, NoSkips_ActiveIdleActive_FramePulledIsPush) {
EXPECT_FALSE(tracker_.IsActive()); EXPECT_FALSE(tracker_.IsActive());
} }
TEST_F(SkippedFrameTrackerTest, NoFrameProduced) {
EXPECT_TRUE(WillProduceFrame());
EXPECT_TRUE(WillNotProduceFrame());
EXPECT_EQ(0, client_.amount_produced_);
EXPECT_EQ(0, client_.amount_skipped_);
}
} // namespace } // namespace
} // namespace ui } // namespace ui
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