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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/rotator/screen_rotation_animation.h
diff --git a/ash/rotator/screen_rotation_animation.h b/ash/rotator/screen_rotation_animation.h
new file mode 100644
index 0000000000000000000000000000000000000000..51fcccad15c03c11da0b7c9dd846bb4e7044df04
--- /dev/null
+++ b/ash/rotator/screen_rotation_animation.h
@@ -0,0 +1,70 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
+#define ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
+
+#include <stdint.h>
+
+#include "ash/ash_export.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/time/time.h"
+#include "ui/compositor/layer_animation_element.h"
+#include "ui/gfx/animation/tween.h"
+#include "ui/gfx/geometry/point.h"
+#include "ui/gfx/geometry/point3_f.h"
+
+namespace ui {
+class InterpolatedTransform;
+class Layer;
+}
+
+namespace ash {
+
+// A LayerAnimationElement that will animate a layer by rotating it around a
+// pivot point.
+class ASH_EXPORT ScreenRotationAnimation : public ui::LayerAnimationElement {
+ public:
+ // Creates an animation element that will rotate |layer| from |start_degrees|
+ // to |end_degrees| around the given |pivot|. The animation will take
+ // |duration| amount of time and |layer| will be scaled as defined by the
+ // |initial_scale| and |target_scale| values.
+ ScreenRotationAnimation(ui::Layer* layer,
+ int start_degrees,
+ int end_degrees,
+ float initial_opacity,
+ float target_opacity,
+ const gfx::Point3F& initial_scale,
+ const gfx::Point3F& target_scale,
+ gfx::Point pivot,
+ base::TimeDelta duration,
+ gfx::Tween::Type twen_type);
+ ~ScreenRotationAnimation() override;
+
+ private:
+ // Implementation of ui::LayerAnimationDelegate
+ void OnStart(ui::LayerAnimationDelegate* delegate) override;
+ bool OnProgress(double current,
+ ui::LayerAnimationDelegate* delegate) override;
+ void OnGetTarget(TargetValue* target) const override;
+ void OnAbort(ui::LayerAnimationDelegate* delegate) override;
+
+ // The root InterpolatedTransform that defines the animation.
+ scoped_ptr<ui::InterpolatedTransform> interpolated_transform_;
+
+ // The Tween type to use for the animation.
+ gfx::Tween::Type tween_type_;
+
+ // The initial layer opacity to start the animation with.
+ float initial_opacity_;
+
+ // The target layer opacity to end the animation with.
+ float target_opacity_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimation);
+};
+
+} // namespace ash
+
+#endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATION_H_
« 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