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 c03f7f79528ed0ed244c2fd301763b2bdfe97f20..5e39cf985357dd67c4f0ecfb11c9e3aa2fd65d09 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -283,6 +283,7 @@ void LayerTreeHostImpl::BeginMainFrameAborted(CommitEarlyOutReason reason) { |
if (CommitEarlyOutHandledCommit(reason)) { |
active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
active_tree_->ResetContentsTexturesPurged(); |
+ RecordMainFrameTiming(); |
} |
} |
@@ -304,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 |
@@ -1798,6 +1804,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(); |
} |
@@ -2072,6 +2082,22 @@ 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::TimeTicks end_time = client_->GetNextBeginImplFrameTimeIfRequested(); |
enne (OOO)
2015/03/06 00:00:57
Maybe I just don't understand the spec, but what i
|
+ frame_timing_tracker_->SaveMainFrameTimeStamps( |
+ request_ids, main_frame_time_, end_time, |
+ active_tree_->source_frame_number()); |
+} |
+ |
void LayerTreeHostImpl::DestroyTileManager() { |
tile_manager_ = nullptr; |
resource_pool_ = nullptr; |