blob: 655d004f71f8cecd0dcfc27a7489b45410677844 [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
Peter Boström03d27022021-09-27 19:45:3931 TransformAnimationCurveAdapter& operator=(
32 const TransformAnimationCurveAdapter&) = delete;
33
dcheng08038792014-10-21 10:53:2634 ~TransformAnimationCurveAdapter() override;
[email protected]f86eb4c2013-01-15 15:21:3535
36 // TransformAnimationCurve implementation.
behara.ms71ff07f32014-11-12 05:09:0837 base::TimeDelta Duration() const override;
Ian Vollicke11d9a82021-02-24 02:34:5138 std::unique_ptr<gfx::AnimationCurve> Clone() const override;
Ian Vollick95a3f4d42021-02-04 00:11:3339 gfx::TransformOperations GetValue(base::TimeDelta t) const override;
awoloszyne83f28c2014-12-22 15:40:0040 bool PreservesAxisAlignment() const override;
Xianzhu Wangd3a17552021-01-15 00:36:2341 bool MaximumScale(float* max_scale) const override;
[email protected]f86eb4c2013-01-15 15:21:3542
43 private:
[email protected]ffb15d12013-09-15 17:29:3044 gfx::Tween::Type tween_type_;
[email protected]f86eb4c2013-01-15 15:21:3545 gfx::Transform initial_value_;
Ian Vollick95a3f4d42021-02-04 00:11:3346 gfx::TransformOperations initial_wrapped_value_;
[email protected]f86eb4c2013-01-15 15:21:3547 gfx::Transform target_value_;
Ian Vollick95a3f4d42021-02-04 00:11:3348 gfx::TransformOperations target_wrapped_value_;
[email protected]f86eb4c2013-01-15 15:21:3549 gfx::DecomposedTransform decomposed_initial_value_;
50 gfx::DecomposedTransform decomposed_target_value_;
51 base::TimeDelta duration_;
[email protected]ca690f92013-09-04 23:59:0052};
53
[email protected]f86eb4c2013-01-15 15:21:3554} // namespace ui
55
56#endif // UI_COMPOSITOR_TRANSFORM_ANIMATION_CURVE_ADAPTER_H_
57