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 2f4d9a9b057cdbb9c21264f24606b5cc6b671726..26909173249142fecf24f09248631b99ab66bc36 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -281,6 +281,7 @@ void LayerTreeHostImpl::BeginMainFrameAborted(CommitEarlyOutReason reason) { |
if (CommitEarlyOutHandledCommit(reason)) { |
active_tree_->ApplySentScrollAndScaleDeltasFromAbortedCommit(); |
active_tree_->ResetContentsTexturesPurged(); |
+ RecordMainFrameTiming(); |
} |
} |
@@ -302,6 +303,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(); |
enne (OOO)
2015/03/06 21:27:55
Is it possible to just do this unconditionally in
|
+ |
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 |
@@ -1793,6 +1799,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(); |
} |
@@ -2067,6 +2077,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(); |
+ 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; |