| 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..3e9b7de9ca26deae5081688bf7ebaa9989adbdf6 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 "base/metrics/histogram_macros.h"
|
| #include "ui/compositor/layer.h"
|
| #include "ui/compositor/layer_animation_sequence.h"
|
| #include "ui/compositor/scoped_layer_animation_settings.h"
|
| @@ -159,6 +161,14 @@ gfx::Transform CalculateRectTransform(const gfx::Vector2dF& center_offset,
|
| return transform;
|
| }
|
|
|
| +class SquareRippleMetricsReporter : public ui::AnimationMetricsReporter {
|
| + void Report(int value) override {
|
| + UMA_HISTOGRAM_PERCENTAGE("Views.AnimationSmoothness.SquareRipple", value);
|
| + }
|
| +};
|
| +base::LazyInstance<SquareRippleMetricsReporter>::Leaky g_reporter =
|
| + LAZY_INSTANCE_INITIALIZER;
|
| +
|
| } // namespace
|
|
|
| namespace views {
|
| @@ -464,6 +474,7 @@ void SquareInkDropRipple::AnimateCenterPoint(
|
| if (observer)
|
| sequence->AddObserver(observer);
|
|
|
| + sequence->SetAnimationMetricsReporter(g_reporter.Pointer());
|
| animator->StartAnimation(sequence);
|
| }
|
|
|
| @@ -487,6 +498,7 @@ void SquareInkDropRipple::AnimateToTransforms(
|
| if (animation_observer)
|
| sequence->AddObserver(animation_observer);
|
|
|
| + sequence->SetAnimationMetricsReporter(g_reporter.Pointer());
|
| animator->StartAnimation(sequence);
|
| }
|
| }
|
| @@ -518,6 +530,7 @@ void SquareInkDropRipple::AnimateToOpacity(
|
| if (animation_observer)
|
| animation_sequence->AddObserver(animation_observer);
|
|
|
| + animation_sequence->SetAnimationMetricsReporter(g_reporter.Pointer());
|
| animator->StartAnimation(animation_sequence);
|
| }
|
|
|
|
|