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