[go: nahoru, domu]

Compute fps graph with a dropped frame counter

Currently fps reflects how many frames are shown on the screen per
seconds. This isn't really helpful because we don't know how many
frames are we expecting to show on screen.

In this CL, we add a DroppedFrameCounter class, which keeps track
of how many frames are expected to show on screen, and how many
of them are dropped. With that, fps graph is different. When a
compositor frame is dropped, it shows a red vertical line. When
a main-frame that misses its commit deadline, it shows a
yellow vertical line. Otherwise, it means a frame is successfully
presented on screen, then we show a green vertical line.

With the new graph, we deprecate the throughput meter that is
beneath the fps graph. Also, instead of showing how many fps,
we show percentage representing throughput.

Bug: 1064290
Change-Id: I04ac95a07cd795c9b33c3c1ec5bfe6fa0529f6e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2244002
Commit-Queue: Xida Chen <xidachen@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781076}
diff --git a/cc/BUILD.gn b/cc/BUILD.gn
index bb28ea30..7e5e837 100644
--- a/cc/BUILD.gn
+++ b/cc/BUILD.gn
@@ -157,6 +157,8 @@
     "metrics/compositor_frame_reporting_controller.h",
     "metrics/compositor_timing_history.cc",
     "metrics/compositor_timing_history.h",
+    "metrics/dropped_frame_counter.cc",
+    "metrics/dropped_frame_counter.h",
     "metrics/event_metrics.cc",
     "metrics/event_metrics.h",
     "metrics/events_metrics_manager.cc",
@@ -312,8 +314,6 @@
     "trees/draw_property_utils.h",
     "trees/effect_node.cc",
     "trees/effect_node.h",
-    "trees/frame_rate_counter.cc",
-    "trees/frame_rate_counter.h",
     "trees/frame_rate_estimator.cc",
     "trees/frame_rate_estimator.h",
     "trees/image_animation_controller.cc",