Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: ash/rotator/screen_rotation_animation.h

Issue 975943002: Implemented screen rotation animation experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ash-screen-rotation-animation entry to histograms.xml. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/rotator/screen_rotation.cc ('k') | ash/rotator/screen_rotation_animation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
6 #define ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
7
8 #include <stdint.h>
9
10 #include "ash/ash_export.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "base/time/time.h"
13 #include "ui/compositor/layer_animation_element.h"
14 #include "ui/gfx/animation/tween.h"
15 #include "ui/gfx/geometry/point.h"
16 #include "ui/gfx/geometry/point3_f.h"
17
18 namespace ui {
19 class InterpolatedTransform;
20 class Layer;
21 }
22
23 namespace ash {
24
25 // A LayerAnimationElement that will animate a layer by rotating it around a
26 // pivot point.
27 class ASH_EXPORT ScreenRotationAnimation : public ui::LayerAnimationElement {
28 public:
29 // Creates an animation element that will rotate |layer| from |start_degrees|
30 // to |end_degrees| around the given |pivot|. The animation will take
31 // |duration| amount of time and |layer| will be scaled as defined by the
32 // |initial_scale| and |target_scale| values.
33 ScreenRotationAnimation(ui::Layer* layer,
34 int start_degrees,
35 int end_degrees,
36 float initial_opacity,
37 float target_opacity,
38 const gfx::Point3F& initial_scale,
39 const gfx::Point3F& target_scale,
40 gfx::Point pivot,
41 base::TimeDelta duration,
42 gfx::Tween::Type twen_type);
43 ~ScreenRotationAnimation() override;
44
45 private:
46 // Implementation of ui::LayerAnimationDelegate
47 void OnStart(ui::LayerAnimationDelegate* delegate) override;
48 bool OnProgress(double current,
49 ui::LayerAnimationDelegate* delegate) override;
50 void OnGetTarget(TargetValue* target) const override;
51 void OnAbort(ui::LayerAnimationDelegate* delegate) override;
52
53 // The root InterpolatedTransform that defines the animation.
54 scoped_ptr<ui::InterpolatedTransform> interpolated_transform_;
55
56 // The Tween type to use for the animation.
57 gfx::Tween::Type tween_type_;
58
59 // The initial layer opacity to start the animation with.
60 float initial_opacity_;
61
62 // The target layer opacity to end the animation with.
63 float target_opacity_;
64
65 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimation);
66 };
67
68 } // namespace ash
69
70 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
OLDNEW
« no previous file with comments | « ash/rotator/screen_rotation.cc ('k') | ash/rotator/screen_rotation_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698