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

Unified Diff: ui/views/animation/flood_fill_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 (committed frames) 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/test/test_layer_animation_delegate.cc ('k') | ui/views/animation/square_ink_drop_ripple.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « ui/compositor/test/test_layer_animation_delegate.cc ('k') | ui/views/animation/square_ink_drop_ripple.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698