void
AnimationMetricsTracker::UpdateAnimationInProgress(AnimationProcessTypes aActive,
                                                   uint64_t aLayerArea,
                                                   TimeDuration aVsyncInterval)
{
  bool inProgress = (aActive != AnimationProcessTypes::eNone);
  MOZ_ASSERT(inProgress || aLayerArea == 0);
  if (mCurrentAnimationStart && !inProgress) {
    AnimationEnded();
    mCurrentAnimationStart = TimeStamp();
    mMaxLayerAreaAnimated = 0;
  } else if (inProgress) {
    if (!mCurrentAnimationStart) {
      mCurrentAnimationStart = TimeStamp::Now();
      mMaxLayerAreaAnimated = aLayerArea;
      AnimationStarted();
    } else {
      mMaxLayerAreaAnimated = std::max(mMaxLayerAreaAnimated, aLayerArea);
    }
  }

  UpdateAnimationThroughput("chrome",
                            (aActive & AnimationProcessTypes::eChrome) != AnimationProcessTypes::eNone,
                            mChromeAnimation,
                            aVsyncInterval,
                            Telemetry::COMPOSITOR_ANIMATION_THROUGHPUT_CHROME,
                            Telemetry::COMPOSITOR_ANIMATION_MAX_CONTIGUOUS_DROPS_CHROME);
  UpdateAnimationThroughput("content",
                            (aActive & AnimationProcessTypes::eContent) != AnimationProcessTypes::eNone,
                            mContentAnimation,
                            aVsyncInterval,
                            Telemetry::COMPOSITOR_ANIMATION_THROUGHPUT_CONTENT,
                            Telemetry::COMPOSITOR_ANIMATION_MAX_CONTIGUOUS_DROPS_CONTENT);
}
Beispiel #2
0
    void Animation::Start()
    {
        if(is_animating_)
        {
            return;
        }

        if(!container_.get())
        {
            container_ = new AnimationContainer();
        }

        is_animating_ = true;

        container_->Start(this);

        AnimationStarted();
    }