// 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. #ifndef CC_TREES_IMAGE_ANIMATION_CONTROLLER_H_ #define CC_TREES_IMAGE_ANIMATION_CONTROLLER_H_ #include <cstdint> #include <optional> #include <string> #include <vector> #include "base/cancelable_callback.h" #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" #include "cc/cc_export.h" #include "cc/paint/discardable_image_map.h" #include "cc/paint/image_id.h" #include "cc/paint/paint_image.h" #include "cc/paint/paint_image_generator.h" #include "cc/tiles/tile_priority.h" #include "components/viz/common/frame_sinks/begin_frame_args.h" namespace base { class SingleThreadTaskRunner; } namespace cc { class PaintImage; // ImageAnimationController is responsible for tracking state for ticking image // animations in the compositor. // // 1) It receives the updated metadata for these images from new recordings // received from the client using UpdateAnimatedImage. The controller tracks // the frame index of an image used on a tree, and advances the animation to // the desired frame each time a new sync tree is created. // // 2) An AnimationDriver can register itself for deciding whether the // controller animates an image. The animation is paused if there are no // registered drivers interested in animating it. // // 3) An animation is only advanced on the sync tree, which is requested to be // created using the |client| callbacks. This effectively means that // the frame of the image used remains consistent throughout the lifetime of // a tree, guaranteeing that the image update is atomic. class CC_EXPORT ImageAnimationController { … }; } // namespace cc #endif // CC_TREES_IMAGE_ANIMATION_CONTROLLER_H_