| Index: cc/trees/layer_tree_host_impl.cc
|
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
|
| index 86401a7dca992c469fca2e80606a9aeac99ff513..95ec1a677b9a3d87ea935d4276550374ef23f524 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -305,6 +305,11 @@ void LayerTreeHostImpl::CommitComplete() {
|
|
|
| sync_tree()->set_needs_update_draw_properties();
|
|
|
| + // If we don't have a pending tree, it means we've committed directly to the
|
| + // active tree. In that case, record frame timing information immediately.
|
| + if (!pending_tree_)
|
| + RecordMainFrameTiming();
|
| +
|
| if (settings_.impl_side_painting) {
|
| // Impl-side painting needs an update immediately post-commit to have the
|
| // opportunity to create tilings. Other paths can call UpdateDrawProperties
|
| @@ -1800,6 +1805,10 @@ void LayerTreeHostImpl::ActivateSyncTree() {
|
| root_layer_scroll_offset_delegate_);
|
|
|
| UpdateViewportContainerSizes();
|
| +
|
| + // If we had a pending tree, now is when we should record main frame timing
|
| + // information.
|
| + RecordMainFrameTiming();
|
| } else {
|
| active_tree_->ProcessUIResourceRequestQueue();
|
| }
|
| @@ -2074,6 +2083,23 @@ void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool(
|
| settings_.renderer_settings.refresh_rate));
|
| }
|
|
|
| +void LayerTreeHostImpl::SetBeginMainFrameTime(base::TimeTicks frame_time) {
|
| + main_frame_time_ = frame_time;
|
| +}
|
| +
|
| +void LayerTreeHostImpl::RecordMainFrameTiming() {
|
| + std::vector<int64_t> request_ids;
|
| + active_tree_->GatherFrameTimingRequestIds(&request_ids);
|
| + if (request_ids.empty())
|
| + return;
|
| +
|
| + base::TimeDelta frame_duration =
|
| + client_->GetNextBeginImplFrameTimeIfRequested() - main_frame_time_;
|
| + frame_timing_tracker_->SaveMainFrameTimeStamps(
|
| + request_ids, main_frame_time_, frame_duration,
|
| + active_tree_->source_frame_number());
|
| +}
|
| +
|
| void LayerTreeHostImpl::DestroyTileManager() {
|
| tile_manager_ = nullptr;
|
| resource_pool_ = nullptr;
|
|
|