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

Unified Diff: cc/trees/layer_tree_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_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 0dc52f21aebe18cb9136c22c5790da266ce26027..1dd5bffed5666e0faf841b17d6c8f32a80ebfb1b 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -8,6 +8,7 @@
#include <limits>
#include <set>
+#include "base/metrics/histogram.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
#include "cc/animation/animation_host.h"
@@ -725,7 +726,9 @@ gfx::Size LayerTreeImpl::ScrollableSize() const {
}
LayerImpl* LayerTreeImpl::LayerById(int id) const {
+ base::TimeTicks start_time = base::TimeTicks::Now();
LayerIdMap::const_iterator iter = layer_id_map_.find(id);
+ find_layer_by_id_stats_ += base::TimeTicks::Now() - start_time;
return iter != layer_id_map_.end() ? iter->second : NULL;
}
@@ -745,6 +748,10 @@ void LayerTreeImpl::UnregisterLayer(LayerImpl* layer) {
layer_id_map_.erase(layer->id());
}
+void LayerTreeImpl::ClearStatsOnFrameEnd() {
+ find_layer_by_id_stats_ = base::TimeDelta();
+}
+
size_t LayerTreeImpl::NumLayers() {
return layer_id_map_.size();
}
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698