Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1172583003: [DRAFT] Animations: Profile hash look-ups for external mutators (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@implscroll
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9dc331f2bdc4e69301efd8aca4b48084732f602a..e9f02d71bfbf1a70a52179318eb0164ea2909375 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1732,6 +1732,8 @@ bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
}
}
renderer_->SwapBuffers(metadata);
+ if (animation_host_)
+ animation_host_->ReportAndClearStatsOnFrameEnd();
return true;
}
@@ -3123,6 +3125,7 @@ void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) {
if (animation_host_) {
if (animation_host_->AnimateLayers(monotonic_time))
SetNeedsAnimate();
+ ReportAndClearStatsAfterAnimateLayers();
} else {
if (animation_registrar_->AnimateLayers(monotonic_time))
SetNeedsAnimate();
@@ -3617,4 +3620,23 @@ gfx::ScrollOffset LayerTreeHostImpl::GetScrollOffsetForAnimation(
return gfx::ScrollOffset();
}
+void LayerTreeHostImpl::ReportAndClearStatsAfterAnimateLayers() {
+ base::TimeDelta find_layer_by_id_stats =
+ active_tree_->find_layer_by_id_stats();
+ active_tree_->ClearStatsOnFrameEnd();
+
+ if (pending_tree_) {
+ find_layer_by_id_stats += pending_tree_->find_layer_by_id_stats();
+ pending_tree_->ClearStatsOnFrameEnd();
+ }
+ if (recycle_tree_) {
+ find_layer_by_id_stats += recycle_tree_->find_layer_by_id_stats();
+ recycle_tree_->ClearStatsOnFrameEnd();
+ }
+
+ LOCAL_HISTOGRAM_CUSTOM_COUNTS("Mutators.FindLayerImplById",
+ find_layer_by_id_stats.InMicroseconds(), 1,
+ 1000, 10);
+}
+
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698