mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
1f59561281
MozReview-Commit-ID: KyvsNSTcxG8 --HG-- extra : rebase_source : 18626f70b714b5bfc815c16422b04258be03e02b
41 lines
1.1 KiB
C++
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
|