Chromium Code Reviews| Index: ui/views/animation/flood_fill_ink_drop_ripple.cc |
| diff --git a/ui/views/animation/flood_fill_ink_drop_ripple.cc b/ui/views/animation/flood_fill_ink_drop_ripple.cc |
| index e542679e98ed3ccb0b681adeef99315ab9a2e254..091093928158539ec8bf2967676779b7c41a528b 100644 |
| --- a/ui/views/animation/flood_fill_ink_drop_ripple.cc |
| +++ b/ui/views/animation/flood_fill_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 "third_party/skia/include/core/SkColor.h" |
| #include "ui/compositor/layer.h" |
| #include "ui/compositor/layer_animation_sequence.h" |
| @@ -113,6 +115,15 @@ float CalculateCircleLayerRadius(const gfx::Rect& clip_bounds) { |
| return std::max(clip_bounds.width(), clip_bounds.height()) / 2.f; |
| } |
| +class FloodRippleMetricsReporter : public ui::AnimationMetricsReporter { |
| + void Report(int value) override { |
| + UMA_HISTOGRAM_PERCENTAGE("Views.AnimationSmoothness.FloodFillRipple", |
|
bruthig
2017/01/24 15:56:30
I'm not sure how helpful it will be to get an aggr
varkha
2017/01/24 20:23:25
I thought of those more as examples to use the new
|
| + value); |
| + } |
| +}; |
| +base::LazyInstance<FloodRippleMetricsReporter>::Leaky g_reporter = |
|
bruthig
2017/01/24 15:56:30
Do these really need to be global state? Would an
varkha
2017/01/24 20:23:25
Chatted offline about it. I think so far with a ve
|
| + LAZY_INSTANCE_INITIALIZER; |
| + |
| } // namespace |
| namespace views { |
| @@ -327,6 +338,7 @@ void FloodFillInkDropRipple::AnimateToTransform( |
| if (animation_observer) |
| sequence->AddObserver(animation_observer); |
| + sequence->SetAnimationMetricsReporter(g_reporter.Pointer()); |
| animator->StartAnimation(sequence); |
| } |
| @@ -348,6 +360,7 @@ void FloodFillInkDropRipple::PauseTransformAnimation( |
| if (observer) |
| sequence->AddObserver(observer); |
| + sequence->SetAnimationMetricsReporter(g_reporter.Pointer()); |
| animator->StartAnimation(sequence); |
| } |
| @@ -373,6 +386,7 @@ void FloodFillInkDropRipple::AnimateToOpacity( |
| if (animation_observer) |
| animation_sequence->AddObserver(animation_observer); |
| + animation_sequence->SetAnimationMetricsReporter(g_reporter.Pointer()); |
| animator->StartAnimation(animation_sequence); |
| } |
| @@ -394,6 +408,7 @@ void FloodFillInkDropRipple::PauseOpacityAnimation( |
| if (observer) |
| sequence->AddObserver(observer); |
| + sequence->SetAnimationMetricsReporter(g_reporter.Pointer()); |
| animator->StartAnimation(sequence); |
| } |