Avi Drissman | 3e1a26c | 2022-09-15 20:26:03 | [diff] [blame] | 1 | // Copyright 2012 The Chromium Authors |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 2 | // 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 | |||||
danakj | 25c52c3 | 2016-04-12 21:51:08 | [diff] [blame] | 8 | #include <memory> |
9 | |||||
[email protected] | e1f5f28 | 2013-06-28 15:22:52 | [diff] [blame] | 10 | #include "base/time/time.h" |
[email protected] | ca690f9 | 2013-09-04 23:59:00 | [diff] [blame] | 11 | #include "ui/compositor/compositor_export.h" |
Ian Vollick | e11d9a8 | 2021-02-24 02:34:51 | [diff] [blame] | 12 | #include "ui/gfx/animation/keyframe/animation_curve.h" |
[email protected] | ffb15d1 | 2013-09-15 17:29:30 | [diff] [blame] | 13 | #include "ui/gfx/animation/tween.h" |
Xianzhu Wang | 3ffdb1d4 | 2022-10-26 23:22:25 | [diff] [blame] | 14 | #include "ui/gfx/geometry/decomposed_transform.h" |
Xianzhu Wang | 65ef1ad3 | 2021-10-07 03:12:33 | [diff] [blame] | 15 | #include "ui/gfx/geometry/transform.h" |
16 | #include "ui/gfx/geometry/transform_operations.h" | ||||
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 17 | |
18 | namespace ui { | ||||
19 | |||||
[email protected] | ca690f9 | 2013-09-04 23:59:00 | [diff] [blame] | 20 | class COMPOSITOR_EXPORT TransformAnimationCurveAdapter |
Ian Vollick | e11d9a8 | 2021-02-24 02:34:51 | [diff] [blame] | 21 | : public gfx::TransformAnimationCurve { |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 22 | public: |
[email protected] | ffb15d1 | 2013-09-15 17:29:30 | [diff] [blame] | 23 | TransformAnimationCurveAdapter(gfx::Tween::Type tween_type, |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 24 | gfx::Transform intial_value, |
25 | gfx::Transform target_value, | ||||
26 | base::TimeDelta duration); | ||||
27 | |||||
vmpstr | 0ae825e7 | 2016-02-25 20:31:31 | [diff] [blame] | 28 | TransformAnimationCurveAdapter(const TransformAnimationCurveAdapter& other); |
29 | |||||
Peter Boström | 03d2702 | 2021-09-27 19:45:39 | [diff] [blame] | 30 | TransformAnimationCurveAdapter& operator=( |
31 | const TransformAnimationCurveAdapter&) = delete; | ||||
32 | |||||
dcheng | 0803879 | 2014-10-21 10:53:26 | [diff] [blame] | 33 | ~TransformAnimationCurveAdapter() override; |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 34 | |
35 | // TransformAnimationCurve implementation. | ||||
behara.ms | 71ff07f3 | 2014-11-12 05:09:08 | [diff] [blame] | 36 | base::TimeDelta Duration() const override; |
Ian Vollick | e11d9a8 | 2021-02-24 02:34:51 | [diff] [blame] | 37 | std::unique_ptr<gfx::AnimationCurve> Clone() const override; |
Ian Vollick | 95a3f4d4 | 2021-02-04 00:11:33 | [diff] [blame] | 38 | gfx::TransformOperations GetValue(base::TimeDelta t) const override; |
Kevin Ellis | df70f1b | 2024-07-19 17:28:58 | [diff] [blame] | 39 | gfx::TransformOperations GetTransformedValue( |
40 | base::TimeDelta t, | ||||
41 | gfx::TimingFunction::LimitDirection) const override; | ||||
awoloszyn | e83f28c | 2014-12-22 15:40:00 | [diff] [blame] | 42 | bool PreservesAxisAlignment() const override; |
Xianzhu Wang | d3a1755 | 2021-01-15 00:36:23 | [diff] [blame] | 43 | bool MaximumScale(float* max_scale) const override; |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 44 | |
45 | private: | ||||
[email protected] | ffb15d1 | 2013-09-15 17:29:30 | [diff] [blame] | 46 | gfx::Tween::Type tween_type_; |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 47 | gfx::Transform initial_value_; |
Ian Vollick | 95a3f4d4 | 2021-02-04 00:11:33 | [diff] [blame] | 48 | gfx::TransformOperations initial_wrapped_value_; |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 49 | gfx::Transform target_value_; |
Ian Vollick | 95a3f4d4 | 2021-02-04 00:11:33 | [diff] [blame] | 50 | gfx::TransformOperations target_wrapped_value_; |
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 51 | gfx::DecomposedTransform decomposed_initial_value_; |
52 | gfx::DecomposedTransform decomposed_target_value_; | ||||
53 | base::TimeDelta duration_; | ||||
[email protected] | ca690f9 | 2013-09-04 23:59:00 | [diff] [blame] | 54 | }; |
55 | |||||
[email protected] | f86eb4c | 2013-01-15 15:21:35 | [diff] [blame] | 56 | } // namespace ui |
57 | |||||
58 | #endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_ | ||||
59 |