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

Unified Diff: ui/views/animation/square_ink_drop_ripple.cc

Issue 2631333002: [animations] Adds metrics for jank on selected layer animations (Closed)
Patch Set: Adds UMA reporting for ripples and overview mode (extern constexpr) 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
Index: ui/views/animation/square_ink_drop_ripple.cc
diff --git a/ui/views/animation/square_ink_drop_ripple.cc b/ui/views/animation/square_ink_drop_ripple.cc
index 6a635a5e8cf6a15a4e10b615ffe32e4b5eef5a30..7fd5378eecb58f63166911f7d4db7449bd1fd3bd 100644
--- a/ui/views/animation/square_ink_drop_ripple.cc
+++ b/ui/views/animation/square_ink_drop_ripple.cc
@@ -6,7 +6,9 @@
#include <algorithm>
+#include "base/lazy_instance.h"
#include "base/logging.h"
+#include "ui/compositor/animation_metrics_reporter_template.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
@@ -159,6 +161,10 @@ gfx::Transform CalculateRectTransform(const gfx::Vector2dF& center_offset,
return transform;
}
+extern constexpr char kMetricName[] = "Views.AnimationSmoothness.SquareRipple";
+base::LazyInstance<ui::AnimationMetricsReporterTemplate<kMetricName>>::Leaky
+ g_reporter = LAZY_INSTANCE_INITIALIZER;
+
} // namespace
namespace views {
@@ -464,6 +470,7 @@ void SquareInkDropRipple::AnimateCenterPoint(
if (observer)
sequence->AddObserver(observer);
+ sequence->SetAnimationMetricsReporter(g_reporter.Pointer());
animator->StartAnimation(sequence);
}
@@ -487,6 +494,7 @@ void SquareInkDropRipple::AnimateToTransforms(
if (animation_observer)
sequence->AddObserver(animation_observer);
+ sequence->SetAnimationMetricsReporter(g_reporter.Pointer());
animator->StartAnimation(sequence);
}
}
@@ -518,6 +526,7 @@ void SquareInkDropRipple::AnimateToOpacity(
if (animation_observer)
animation_sequence->AddObserver(animation_observer);
+ animation_sequence->SetAnimationMetricsReporter(g_reporter.Pointer());
animator->StartAnimation(animation_sequence);
}
« ui/compositor/layer_animation_element.cc ('K') | « ui/views/animation/flood_fill_ink_drop_ripple.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698