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_; |
enne (OOO)
2015/02/12 23:41:07
So for SingleThreadProxy this will always be negat
vmpstr
2015/03/03 18:56:46
I changed this to use the same value. As far as I
enne (OOO)
2015/03/06 21:27:55
Oh. I figured that requests were coming from Java
|
+ 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; |