blob: f99fe728cf346736900615450c5b636ca11d0a0b [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2012 The Chromium Authors
[email protected]f86eb4c2013-01-15 15:21:352// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_
6#define UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_
7
danakj25c52c32016-04-12 21:51:088#include <memory>
9
[email protected]e1f5f282013-06-28 15:22:5210#include "base/time/time.h"
[email protected]ca690f92013-09-04 23:59:0011#include "ui/compositor/compositor_export.h"
Ian Vollicke11d9a82021-02-24 02:34:5112#include "ui/gfx/animation/keyframe/animation_curve.h"
[email protected]ffb15d12013-09-15 17:29:3013#include "ui/gfx/animation/tween.h"
Xianzhu Wang3ffdb1d42022-10-26 23:22:2514#include "ui/gfx/geometry/decomposed_transform.h"
Xianzhu Wang65ef1ad32021-10-07 03:12:3315#include "ui/gfx/geometry/transform.h"
16#include "ui/gfx/geometry/transform_operations.h"
[email protected]f86eb4c2013-01-15 15:21:3517
18namespace ui {
19
[email protected]ca690f92013-09-04 23:59:0020class COMPOSITOR_EXPORT TransformAnimationCurveAdapter
Ian Vollicke11d9a82021-02-24 02:34:5121 : public gfx::TransformAnimationCurve {
[email protected]f86eb4c2013-01-15 15:21:3522 public:
[email protected]ffb15d12013-09-15 17:29:3023 TransformAnimationCurveAdapter(gfx::Tween::Type tween_type,
[email protected]f86eb4c2013-01-15 15:21:3524 gfx::Transform intial_value,
25 gfx::Transform target_value,
26 base::TimeDelta duration);
27
vmpstr0ae825e72016-02-25 20:31:3128 TransformAnimationCurveAdapter(const TransformAnimationCurveAdapter& other);
29
Peter Boström03d27022021-09-27 19:45:3930 TransformAnimationCurveAdapter& operator=(
31 const TransformAnimationCurveAdapter&) = delete;
32
dcheng08038792014-10-21 10:53:2633 ~TransformAnimationCurveAdapter() override;
[email protected]f86eb4c2013-01-15 15:21:3534
35 // TransformAnimationCurve implementation.
behara.ms71ff07f32014-11-12 05:09:0836 base::TimeDelta Duration() const override;
Ian Vollicke11d9a82021-02-24 02:34:5137 std::unique_ptr<gfx::AnimationCurve> Clone() const override;
Ian Vollick95a3f4d42021-02-04 00:11:3338 gfx::TransformOperations GetValue(base::TimeDelta t) const override;
Kevin Ellisdf70f1b2024-07-19 17:28:5839 gfx::TransformOperations GetTransformedValue(
40 base::TimeDelta t,
41 gfx::TimingFunction::LimitDirection) const override;
awoloszyne83f28c2014-12-22 15:40:0042 bool PreservesAxisAlignment() const override;
Xianzhu Wangd3a17552021-01-15 00:36:2343 bool MaximumScale(float* max_scale) const override;
[email protected]f86eb4c2013-01-15 15:21:3544
45 private:
[email protected]ffb15d12013-09-15 17:29:3046 gfx::Tween::Type tween_type_;
[email protected]f86eb4c2013-01-15 15:21:3547 gfx::Transform initial_value_;
Ian Vollick95a3f4d42021-02-04 00:11:3348 gfx::TransformOperations initial_wrapped_value_;
[email protected]f86eb4c2013-01-15 15:21:3549 gfx::Transform target_value_;
Ian Vollick95a3f4d42021-02-04 00:11:3350 gfx::TransformOperations target_wrapped_value_;
[email protected]f86eb4c2013-01-15 15:21:3551 gfx::DecomposedTransform decomposed_initial_value_;
52 gfx::DecomposedTransform decomposed_target_value_;
53 base::TimeDelta duration_;
[email protected]ca690f92013-09-04 23:59:0054};
55
[email protected]f86eb4c2013-01-15 15:21:3556} // namespace ui
57
58#endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_
59