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

Unified Diff: cc/animation/animation_host.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/animation/animation_host.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_host.cc
diff --git a/cc/animation/animation_host.cc b/cc/animation/animation_host.cc
index d61b510f8ea0fe82ca03a3361a7d494d35d69385..ff9af04edd97ad7b69b05833c0af0f2a0c0694d8 100644
--- a/cc/animation/animation_host.cc
+++ b/cc/animation/animation_host.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/metrics/histogram.h"
#include "cc/animation/animation_delegate.h"
#include "cc/animation/animation_id_provider.h"
#include "cc/animation/animation_player.h"
@@ -217,6 +218,18 @@ void AnimationHost::SetNeedsCommit() {
layer_tree_mutators_client_->SetMutatorsNeedCommit();
}
+void AnimationHost::ReportAndClearStatsOnFrameEnd() {
+ if (is_impl_instance_)
+ LOCAL_HISTOGRAM_CUSTOM_COUNTS(
+ "Mutators.FindPlayerForLayerImplId",
+ find_player_for_layer_id_stats_.InMicroseconds(), 1, 1000, 10);
+ else
+ LOCAL_HISTOGRAM_CUSTOM_COUNTS(
+ "Mutators.FindPlayerForLayerId",
+ find_player_for_layer_id_stats_.InMicroseconds(), 1, 1000, 10);
+ find_player_for_layer_id_stats_ = base::TimeDelta();
+}
+
void AnimationHost::PushPropertiesTo(AnimationHost* host_impl) {
PushTimelinesToImplThread(host_impl);
RemoveTimelinesFromImplThread(host_impl);
@@ -260,7 +273,9 @@ void AnimationHost::PushPropertiesToImplThread(AnimationHost* host_impl) {
AnimationPlayer* AnimationHost::GetPlayerForLayerId(int layer_id) const {
DCHECK(layer_id);
+ base::TimeTicks start_time = base::TimeTicks::Now();
auto iter = layer_to_player_map_.find(layer_id);
+ find_player_for_layer_id_stats_ += base::TimeTicks::Now() - start_time;
return iter == layer_to_player_map_.end() ? nullptr : iter->second;
}
« no previous file with comments | « cc/animation/animation_host.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698