blob: 6f12dd3dfffe476f0dec4a61249f79f0054a6760 [file] [log] [blame]
[email protected]f86eb4c2013-01-15 15:21:351// 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
danakj25c52c32016-04-12 21:51:088#include <memory>
9
avi87b8b582015-12-24 21:35:2510#include "base/macros.h"
[email protected]e1f5f282013-06-28 15:22:5211#include "base/time/time.h"
[email protected]ca690f92013-09-04 23:59:0012#include "ui/compositor/compositor_export.h"
Ian Vollicke11d9a82021-02-24 02:34:5113#include "ui/gfx/animation/keyframe/animation_curve.h"
[email protected]ffb15d12013-09-15 17:29:3014#include "ui/gfx/animation/tween.h"
[email protected]f86eb4c2013-01-15 15:21:3515#include "ui/gfx/transform.h"
Ian Vollick95a3f4d42021-02-04 00:11:3316#include "ui/gfx/transform_operations.h"
[email protected]f86eb4c2013-01-15 15:21:3517#include "ui/gfx/transform_util.h"
18
19namespace ui {
20
[email protected]ca690f92013-09-04 23:59:0021class COMPOSITOR_EXPORT TransformAnimationCurveAdapter
Ian Vollicke11d9a82021-02-24 02:34:5122 : public gfx::TransformAnimationCurve {
[email protected]f86eb4c2013-01-15 15:21:3523 public:
[email protected]ffb15d12013-09-15 17:29:3024 TransformAnimationCurveAdapter(gfx::Tween::Type tween_type,
[email protected]f86eb4c2013-01-15 15:21:3525 gfx::Transform intial_value,
26 gfx::Transform target_value,
27 base::TimeDelta duration);
28
vmpstr0ae825e72016-02-25 20:31:3129 TransformAnimationCurveAdapter(const TransformAnimationCurveAdapter& other);
30
dcheng08038792014-10-21 10:53:2631 ~TransformAnimationCurveAdapter() override;
[email protected]f86eb4c2013-01-15 15:21:3532
33 // TransformAnimationCurve implementation.
behara.ms71ff07f32014-11-12 05:09:0834 base::TimeDelta Duration() const override;
Ian Vollicke11d9a82021-02-24 02:34:5135 std::unique_ptr<gfx::AnimationCurve> Clone() const override;
Ian Vollick95a3f4d42021-02-04 00:11:3336 gfx::TransformOperations GetValue(base::TimeDelta t) const override;
awoloszyne83f28c2014-12-22 15:40:0037 bool PreservesAxisAlignment() const override;
Xianzhu Wangd3a17552021-01-15 00:36:2338 bool MaximumScale(float* max_scale) const override;
[email protected]f86eb4c2013-01-15 15:21:3539
40 private:
[email protected]ffb15d12013-09-15 17:29:3041 gfx::Tween::Type tween_type_;
[email protected]f86eb4c2013-01-15 15:21:3542 gfx::Transform initial_value_;
Ian Vollick95a3f4d42021-02-04 00:11:3343 gfx::TransformOperations initial_wrapped_value_;
[email protected]f86eb4c2013-01-15 15:21:3544 gfx::Transform target_value_;
Ian Vollick95a3f4d42021-02-04 00:11:3345 gfx::TransformOperations target_wrapped_value_;
[email protected]f86eb4c2013-01-15 15:21:3546 gfx::DecomposedTransform decomposed_initial_value_;
47 gfx::DecomposedTransform decomposed_target_value_;
48 base::TimeDelta duration_;
[email protected]ca690f92013-09-04 23:59:0049
50 DISALLOW_ASSIGN(TransformAnimationCurveAdapter);
51};
52
[email protected]f86eb4c2013-01-15 15:21:3553} // namespace ui
54
55#endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_
56