gecko-dev/gfx/layers/composite/AnimationMetricsTracker.h
Kartikaya Gupta 1f59561281 Bug 1339220 - Add telemetry probes to measure duration and max-area of animations in the compositor. r=botond,bsmedberg
MozReview-Commit-ID: KyvsNSTcxG8

--HG--
extra : rebase_source : 18626f70b714b5bfc815c16422b04258be03e02b
2017-02-16 14:40:37 -05:00

41 lines
1.1 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_layers_AnimationMetricsTracker_h
#define mozilla_layers_AnimationMetricsTracker_h
#include "mozilla/TimeStamp.h"
namespace mozilla {
namespace layers {
/**
* Tracks the start and end of compositor animations.
*/
class AnimationMetricsTracker {
public:
AnimationMetricsTracker();
~AnimationMetricsTracker();
/**
* This function should be called per composite, to inform the metrics
* tracker if any animation is in progress, and if so, what area is
* being animated. The aLayerArea is in Layer pixels squared.
*/
void UpdateAnimationInProgress(bool aInProgress, uint64_t aLayerArea);
private:
void AnimationStarted();
void AnimationEnded();
TimeStamp mCurrentAnimationStart;
uint64_t mMaxLayerAreaAnimated;
};
} // namespace layers
} // namespace mozilla
#endif // mozilla_layers_AnimationMetricsTracker_h