diff options
Diffstat (limited to 'chromium/cc/metrics/compositor_timing_history.cc')
-rw-r--r-- | chromium/cc/metrics/compositor_timing_history.cc | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/chromium/cc/metrics/compositor_timing_history.cc b/chromium/cc/metrics/compositor_timing_history.cc index 0e478f818db..d244237b7e9 100644 --- a/chromium/cc/metrics/compositor_timing_history.cc +++ b/chromium/cc/metrics/compositor_timing_history.cc @@ -48,13 +48,15 @@ class CompositorTimingHistory::UMAReporter { virtual void AddDrawDuration(base::TimeDelta duration) = 0; virtual void AddSubmitToAckLatency(base::TimeDelta duration) = 0; - // crbug.com/758439: the following 3 functions are used to report timing in + // crbug.com/758439: the following functions are used to report timing in // certain conditions targeting blink / compositor animations. // Only the renderer would get the meaningful data. virtual void AddDrawIntervalWithCompositedAnimations( base::TimeDelta duration) = 0; virtual void AddDrawIntervalWithMainThreadAnimations( base::TimeDelta duration) = 0; + virtual void AddDrawIntervalWithCustomPropertyAnimations( + base::TimeDelta duration) = 0; // Synchronization measurements virtual void AddMainAndImplFrameTimeDelta(base::TimeDelta delta) = 0; @@ -329,6 +331,13 @@ class RendererUMAReporter : public CompositorTimingHistory::UMAReporter { "Scheduling.Renderer.DrawIntervalWithMainThreadAnimations", interval); } + void AddDrawIntervalWithCustomPropertyAnimations( + base::TimeDelta interval) override { + UMA_HISTOGRAM_CUSTOM_TIMES_VSYNC_ALIGNED( + "Scheduling.Renderer.DrawIntervalWithCustomPropertyAnimations", + interval); + } + void AddBeginImplFrameLatency(base::TimeDelta delta) override { UMA_HISTOGRAM_CUSTOM_TIMES_DURATION( "Scheduling.Renderer.BeginImplFrameLatency", delta); @@ -432,6 +441,9 @@ class BrowserUMAReporter : public CompositorTimingHistory::UMAReporter { void AddDrawIntervalWithMainThreadAnimations( base::TimeDelta interval) override {} + void AddDrawIntervalWithCustomPropertyAnimations( + base::TimeDelta interval) override {} + void AddBeginImplFrameLatency(base::TimeDelta delta) override { UMA_HISTOGRAM_CUSTOM_TIMES_DURATION( "Scheduling.Browser.BeginImplFrameLatency", delta); @@ -507,6 +519,8 @@ class NullUMAReporter : public CompositorTimingHistory::UMAReporter { base::TimeDelta inverval) override {} void AddDrawIntervalWithMainThreadAnimations( base::TimeDelta inverval) override {} + void AddDrawIntervalWithCustomPropertyAnimations( + base::TimeDelta inverval) override {} void AddBeginImplFrameLatency(base::TimeDelta delta) override {} void AddBeginMainFrameQueueDurationCriticalDuration( base::TimeDelta duration) override {} @@ -721,6 +735,8 @@ void CompositorTimingHistory::WillBeginImplFrame( void CompositorTimingHistory::WillFinishImplFrame(bool needs_redraw) { if (!needs_redraw) SetCompositorDrawingContinuously(false); + + compositor_frame_reporting_controller_->OnFinishImplFrame(); } void CompositorTimingHistory::BeginImplFrameNotExpectedSoon() { @@ -964,7 +980,8 @@ void CompositorTimingHistory::DidDraw(bool used_new_active_tree, size_t composited_animations_count, size_t main_thread_animations_count, bool current_frame_had_raf, - bool next_frame_has_pending_raf) { + bool next_frame_has_pending_raf, + bool has_custom_property_animations) { DCHECK_NE(base::TimeTicks(), draw_start_time_); base::TimeTicks draw_end_time = Now(); base::TimeDelta draw_duration = draw_end_time - draw_start_time_; @@ -989,8 +1006,13 @@ void CompositorTimingHistory::DidDraw(bool used_new_active_tree, if (composited_animations_count > 0 && previous_frame_had_composited_animations_) uma_reporter_->AddDrawIntervalWithCompositedAnimations(draw_interval); + if (has_custom_property_animations && + previous_frame_had_custom_property_animations_) + uma_reporter_->AddDrawIntervalWithCustomPropertyAnimations(draw_interval); } previous_frame_had_composited_animations_ = composited_animations_count > 0; + previous_frame_had_custom_property_animations_ = + has_custom_property_animations; draw_end_time_prev_ = draw_end_time; if (used_new_active_tree) { @@ -1049,10 +1071,6 @@ void CompositorTimingHistory::DidSubmitCompositorFrame(uint32_t frame_token) { submit_start_time_ = Now(); } -void CompositorTimingHistory::DidNotProduceFrame() { - compositor_frame_reporting_controller_->DidNotProduceFrame(); -} - void CompositorTimingHistory::DidReceiveCompositorFrameAck() { DCHECK_NE(base::TimeTicks(), submit_start_time_); base::TimeDelta submit_to_ack_duration = Now() - submit_start_time_; @@ -1062,9 +1080,9 @@ void CompositorTimingHistory::DidReceiveCompositorFrameAck() { void CompositorTimingHistory::DidPresentCompositorFrame( uint32_t frame_token, - base::TimeTicks presentation_time) { - compositor_frame_reporting_controller_->DidPresentCompositorFrame( - frame_token, presentation_time); + const viz::FrameTimingDetails& details) { + compositor_frame_reporting_controller_->DidPresentCompositorFrame(frame_token, + details); } void CompositorTimingHistory::SetTreePriority(TreePriority priority) { |