// 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 THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_TRANSITION_INTERPOLATION_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_TRANSITION_INTERPOLATION_H_ #include <optional> #include "base/check_op.h" #include "third_party/blink/renderer/core/animation/compositor_animations.h" #include "third_party/blink/renderer/core/animation/interpolation.h" #include "third_party/blink/renderer/core/animation/interpolation_type.h" #include "third_party/blink/renderer/core/core_export.h" namespace blink { class InterpolationEnvironment; // See the documentation of Interpolation for general information about this // class hierarchy. // // The primary difference between TransitionInterpolation and other // Interpolation subclasses is that it must store additional data required for // retargeting transition effects that were sent to the compositor thread. // Retargeting a transition involves interrupting an in-progress transition and // creating a new transition from the current state to the new end state. // // The TransitionInterpolation subclass stores the start and end keyframes as // InterpolationValue objects, with an InterpolationType object that applies to // both InterpolationValues. It additionally stores CompositorKeyframeValue // objects corresponding to start and end keyframes as communicated to the // compositor thread. Together, this is equivalent to representing the start and // end keyframes as TransitionPropertySpecificKeyframe objects with the added // constraint that they share an InterpolationType. // TODO(crbug.com/442163): Store information for communication with the // compositor without using CompositorKeyframeValue objects. // // During the effect application phase of animation computation, the current // value of the property is applied to the element by calling the Apply // function. class CORE_EXPORT TransitionInterpolation : public Interpolation { … }; template <> struct DowncastTraits<TransitionInterpolation> { … }; } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_TRANSITION_INTERPOLATION_H_