chromium/cc/trees/image_animation_controller.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cc/trees/image_animation_controller.h"

#include <algorithm>
#include <sstream>

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/notreached.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "cc/base/features.h"
#include "cc/paint/image_animation_count.h"

namespace cc {
namespace {

// The maximum number of time an animation can be delayed before it is reset to
// start from the beginning, instead of fast-forwarding to catch up to the
// desired frame.
const base::TimeDelta kAnimationResyncCutoff =;

// Given the |desired_frame_time|, returns the time of the tick it should be
// snapped to.
base::TimeTicks SnappedTickTimeFromFrameTime(
    const viz::BeginFrameArgs& args,
    base::TimeTicks desired_frame_time) {}

}  //  namespace

ImageAnimationController::ImageAnimationController(
    base::SingleThreadTaskRunner* task_runner,
    Client* client,
    bool enable_image_animation_resync)
    :{}

ImageAnimationController::~ImageAnimationController() = default;

void ImageAnimationController::UpdateAnimatedImage(
    const DiscardableImageMap::AnimatedImageMetadata& data) {}

void ImageAnimationController::RegisterAnimationDriver(
    PaintImage::Id paint_image_id,
    AnimationDriver* driver) {}

void ImageAnimationController::UnregisterAnimationDriver(
    PaintImage::Id paint_image_id,
    AnimationDriver* driver) {}

bool ImageAnimationController::IsRegistered(PaintImage::Id paint_image_id) {}

const PaintImageIdFlatSet& ImageAnimationController::AnimateForSyncTree(
    const viz::BeginFrameArgs& args) {}

void ImageAnimationController::UpdateStateFromDrivers() {}

void ImageAnimationController::DidActivate() {}

size_t ImageAnimationController::GetFrameIndexForImage(
    PaintImage::Id paint_image_id,
    WhichTree tree) const {}

void ImageAnimationController::WillBeginImplFrame(
    const viz::BeginFrameArgs& args) {}

const base::flat_set<
    raw_ptr<ImageAnimationController::AnimationDriver, CtnExperimental>>&
ImageAnimationController::GetDriversForTesting(
    PaintImage::Id paint_image_id) const {}

size_t ImageAnimationController::GetLastNumOfFramesSkippedForTesting(
    PaintImage::Id paint_image_id) const {}

std::optional<ImageAnimationController::ConsistentFrameDuration>
ImageAnimationController::GetConsistentContentFrameDuration() {}

ImageAnimationController::AnimationState::AnimationState() = default;

ImageAnimationController::AnimationState::AnimationState(
    AnimationState&& other) = default;

ImageAnimationController::AnimationState&
ImageAnimationController::AnimationState::operator=(AnimationState&& other) =
    default;

ImageAnimationController::AnimationState::~AnimationState() {}

bool ImageAnimationController::AnimationState::ShouldAnimate() const {}

bool ImageAnimationController::AnimationState::ShouldAnimate(
    int repetitions_completed,
    size_t pending_index) const {}

// SCHEDULING
// The rate at which the animation progresses is decided by the frame duration,
// the time for which a particular frame should be displayed, specified in the
// metadata for the image. The animation is assumed to start from the frame_time
// of the first BeginFrame after the animation is registered and is visible.
// From here on, the time at which a frame should be displayed is the sum of
// durations for all previous frames of the animation.
// But, in order to align the work for the animation update with an impl frame,
// invalidations are requested at the beginning of the frame boundary in which
// the frame should be displayed.
bool ImageAnimationController::AnimationState::AdvanceFrame(
    const viz::BeginFrameArgs& args,
    bool enable_image_animation_resync,
    bool use_resume_behavior) {}

ImageAnimationController::AnimationState::AnimationAdvancementState
ImageAnimationController::AnimationState::AdvanceAnimationState(
    AnimationAdvancementState animation_advancement_state,
    const viz::BeginFrameArgs& args,
    base::TimeTicks start,
    bool enable_image_animation_resync) const {}

void ImageAnimationController::AnimationState::UpdateMetadata(
    const DiscardableImageMap::AnimatedImageMetadata& data) {}

void ImageAnimationController::AnimationState::PushPendingToActive() {}

std::optional<base::TimeDelta>
ImageAnimationController::AnimationState::GetConsistentContentFrameDuration() {}

void ImageAnimationController::AnimationState::
    ComputeConsistentContentFrameDuration() {}

void ImageAnimationController::AnimationState::AddDriver(
    AnimationDriver* driver) {}

void ImageAnimationController::AnimationState::RemoveDriver(
    AnimationDriver* driver) {}

void ImageAnimationController::AnimationState::UpdateStateFromDrivers() {}

void ImageAnimationController::AnimationState::ResetAnimation() {}

std::string ImageAnimationController::AnimationState::ToString() const {}

size_t ImageAnimationController::AnimationState::NextFrameIndex(
    size_t pending_index) const {}

ImageAnimationController::InvalidationScheduler::InvalidationScheduler(
    base::SingleThreadTaskRunner* task_runner,
    Client* client)
    :{}

ImageAnimationController::InvalidationScheduler::~InvalidationScheduler() {}

void ImageAnimationController::InvalidationScheduler::Schedule(
    base::TimeTicks animation_time) {}

void ImageAnimationController::InvalidationScheduler::Cancel() {}

void ImageAnimationController::InvalidationScheduler::RequestBeginFrame() {}

void ImageAnimationController::InvalidationScheduler::WillAnimate() {}

void ImageAnimationController::InvalidationScheduler::WillBeginImplFrame(
    const viz::BeginFrameArgs& args) {}

void ImageAnimationController::InvalidationScheduler::RequestInvalidation() {}

}  // namespace cc