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

Unified Diff: ui/compositor/layer_animation_sequence.cc

Issue 2631333002: [animations] Adds metrics for jank on selected layer animations (Closed)
Patch Set: Adds UMA reporting for ripples and overview mode (query refresh rate) Created 3 years, 11 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 | « ui/compositor/layer_animation_sequence.h ('k') | ui/compositor/layer_animator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_sequence.cc
diff --git a/ui/compositor/layer_animation_sequence.cc b/ui/compositor/layer_animation_sequence.cc
index 773cbb4021cee7a9728bee6d9eb4c7fb48823739..d1739e7ee06ee096d2714642848e9fc7cc31ae02 100644
--- a/ui/compositor/layer_animation_sequence.cc
+++ b/ui/compositor/layer_animation_sequence.cc
@@ -22,8 +22,8 @@ LayerAnimationSequence::LayerAnimationSequence()
waiting_for_group_start_(false),
animation_group_id_(0),
last_progressed_fraction_(0.0),
- weak_ptr_factory_(this) {
-}
+ animation_metrics_reporter_(nullptr),
+ weak_ptr_factory_(this) {}
LayerAnimationSequence::LayerAnimationSequence(
std::unique_ptr<LayerAnimationElement> element)
@@ -33,6 +33,7 @@ LayerAnimationSequence::LayerAnimationSequence(
waiting_for_group_start_(false),
animation_group_id_(0),
last_progressed_fraction_(0.0),
+ animation_metrics_reporter_(nullptr),
weak_ptr_factory_(this) {
AddElement(std::move(element));
}
@@ -186,6 +187,7 @@ void LayerAnimationSequence::Abort(LayerAnimationDelegate* delegate) {
void LayerAnimationSequence::AddElement(
std::unique_ptr<LayerAnimationElement> element) {
properties_ |= element->properties();
+ element->set_animation_metrics_reporter(animation_metrics_reporter_);
elements_.push_back(std::move(element));
}
@@ -243,6 +245,13 @@ void LayerAnimationSequence::OnAnimatorDestroyed() {
}
}
+void LayerAnimationSequence::SetAnimationMetricsReporter(
+ AnimationMetricsReporter* reporter) {
+ animation_metrics_reporter_ = reporter;
+ for (auto& element : elements_)
+ element->set_animation_metrics_reporter(animation_metrics_reporter_);
+}
+
size_t LayerAnimationSequence::size() const {
return elements_.size();
}
« no previous file with comments | « ui/compositor/layer_animation_sequence.h ('k') | ui/compositor/layer_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698