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

Unified Diff: ui/compositor/layer_animation_element.h

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_delegate.h ('k') | ui/compositor/layer_animation_element.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_element.h
diff --git a/ui/compositor/layer_animation_element.h b/ui/compositor/layer_animation_element.h
index f847e42b8d3ba4816774d0d0f961fc12259aca50..664468e3bc17ca08f1d10947cb135c13f4bf6f4c 100644
--- a/ui/compositor/layer_animation_element.h
+++ b/ui/compositor/layer_animation_element.h
@@ -25,6 +25,12 @@ namespace ui {
class InterpolatedTransform;
class LayerAnimationDelegate;
+class AnimationMetricsReporter {
+ public:
+ virtual ~AnimationMetricsReporter() {}
+ virtual void Report(int value) = 0;
+};
+
// LayerAnimationElements represent one segment of an animation between two
// keyframes. They know how to update a LayerAnimationDelegate given a value
// between 0 and 1 (0 for initial, and 1 for final).
@@ -182,6 +188,10 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
gfx::Tween::Type tween_type() const { return tween_type_; }
void set_tween_type(gfx::Tween::Type tween_type) { tween_type_ = tween_type; }
+ void set_animation_metrics_reporter(AnimationMetricsReporter* reporter) {
+ animation_metrics_reporter_ = reporter;
+ }
+
// Each LayerAnimationElement has a unique animation_id. Elements belonging
// to sequences that are supposed to start together have the same
// animation_group_id.
@@ -228,6 +238,11 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
double last_progressed_fraction_;
+ // To obtain metrics of animation performance tag animation elements and
+ // keep track of sequential compositor frame number.
+ AnimationMetricsReporter* animation_metrics_reporter_;
+ int start_frame_number_;
+
base::WeakPtrFactory<LayerAnimationElement> weak_ptr_factory_;
DISALLOW_ASSIGN(LayerAnimationElement);
« no previous file with comments | « ui/compositor/layer_animation_delegate.h ('k') | ui/compositor/layer_animation_element.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698