| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/scheduler/compositor_timing_history.h" | 5 #include "cc/scheduler/compositor_timing_history.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } | 432 } |
| 433 | 433 |
| 434 base::TimeDelta CompositorTimingHistory::ActivateDurationEstimate() const { | 434 base::TimeDelta CompositorTimingHistory::ActivateDurationEstimate() const { |
| 435 return activate_duration_history_.Percentile(kActivateEstimationPercentile); | 435 return activate_duration_history_.Percentile(kActivateEstimationPercentile); |
| 436 } | 436 } |
| 437 | 437 |
| 438 base::TimeDelta CompositorTimingHistory::DrawDurationEstimate() const { | 438 base::TimeDelta CompositorTimingHistory::DrawDurationEstimate() const { |
| 439 return draw_duration_history_.Percentile(kDrawEstimationPercentile); | 439 return draw_duration_history_.Percentile(kDrawEstimationPercentile); |
| 440 } | 440 } |
| 441 | 441 |
| 442 void CompositorTimingHistory::DidCreateAndInitializeOutputSurface() { | 442 void CompositorTimingHistory::DidCreateAndInitializeCompositorFrameSink() { |
| 443 // After we get a new output surface, we won't get a spurious | 443 // After we get a new output surface, we won't get a spurious |
| 444 // swap ack from the old output surface. | 444 // swap ack from the old output surface. |
| 445 swap_start_time_ = base::TimeTicks(); | 445 swap_start_time_ = base::TimeTicks(); |
| 446 } | 446 } |
| 447 | 447 |
| 448 void CompositorTimingHistory::WillBeginImplFrame( | 448 void CompositorTimingHistory::WillBeginImplFrame( |
| 449 bool new_active_tree_is_likely) { | 449 bool new_active_tree_is_likely) { |
| 450 // The check for whether a BeginMainFrame was sent anytime between two | 450 // The check for whether a BeginMainFrame was sent anytime between two |
| 451 // BeginImplFrames protects us from not detecting a fast main thread that | 451 // BeginImplFrames protects us from not detecting a fast main thread that |
| 452 // does all it's work and goes idle in between BeginImplFrames. | 452 // does all it's work and goes idle in between BeginImplFrames. |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 } | 700 } |
| 701 | 701 |
| 702 void CompositorTimingHistory::DidSwapBuffersComplete() { | 702 void CompositorTimingHistory::DidSwapBuffersComplete() { |
| 703 DCHECK_NE(base::TimeTicks(), swap_start_time_); | 703 DCHECK_NE(base::TimeTicks(), swap_start_time_); |
| 704 base::TimeDelta swap_to_ack_duration = Now() - swap_start_time_; | 704 base::TimeDelta swap_to_ack_duration = Now() - swap_start_time_; |
| 705 uma_reporter_->AddSwapToAckLatency(swap_to_ack_duration); | 705 uma_reporter_->AddSwapToAckLatency(swap_to_ack_duration); |
| 706 swap_start_time_ = base::TimeTicks(); | 706 swap_start_time_ = base::TimeTicks(); |
| 707 } | 707 } |
| 708 | 708 |
| 709 } // namespace cc | 709 } // namespace cc |
| OLD | NEW |