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

Unified Diff: chrome/browser/android/vr_shell/easing.h

Issue 2966793002: NOT FOR REVIEW - convert to cc animation
Patch Set: switch to transform operations Created 3 years, 6 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 | « chrome/browser/android/vr_shell/animation.cc ('k') | chrome/browser/android/vr_shell/easing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/vr_shell/easing.h
diff --git a/chrome/browser/android/vr_shell/easing.h b/chrome/browser/android/vr_shell/easing.h
deleted file mode 100644
index 069815401f11f99cbb799cf0c8a4b7c9fb7ebe62..0000000000000000000000000000000000000000
--- a/chrome/browser/android/vr_shell/easing.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2016 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 CHROME_BROWSER_ANDROID_VR_SHELL_EASING_H_
-#define CHROME_BROWSER_ANDROID_VR_SHELL_EASING_H_
-
-#include "base/macros.h"
-#include "ui/gfx/geometry/cubic_bezier.h"
-
-namespace vr_shell {
-namespace easing {
-
-enum EasingType {
- LINEAR = 0,
- CUBICBEZIER,
- EASEIN,
- EASEOUT,
- EASEINOUT,
-};
-
-// Abstract base class for custom interpolators, mapping linear input between
-// 0 and 1 to custom values between those two points.
-class Easing {
- public:
- // Compute an output value, given an input between 0 and 1. Output will
- // equal input at (at least) points 0 and 1.
- double CalculateValue(double input);
- virtual ~Easing() {}
-
- protected:
- Easing() {}
- virtual double CalculateValueImpl(double input) = 0;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Easing);
-};
-
-// Linear interpolation generates output equal to input.
-class Linear : public Easing {
- public:
- Linear() = default;
- double CalculateValueImpl(double input) override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(Linear);
-};
-
-// Computes a cubic-bezier transition based on two control points.
-class CubicBezier : public Easing {
- public:
- CubicBezier(double p1x, double p1y, double p2x, double p2y);
- double CalculateValueImpl(double input) override;
-
- private:
- gfx::CubicBezier bezier_;
- DISALLOW_COPY_AND_ASSIGN(CubicBezier);
-};
-
-// Computes |input|^|power|.
-class EaseIn : public Easing {
- public:
- explicit EaseIn(double power);
- double CalculateValueImpl(double input) override;
-
- private:
- double power_;
- DISALLOW_COPY_AND_ASSIGN(EaseIn);
-};
-
-// Computes 1 - |input|^|power|.
-class EaseOut : public Easing {
- public:
- explicit EaseOut(double power);
- double CalculateValueImpl(double input) override;
-
- private:
- double power_;
- DISALLOW_COPY_AND_ASSIGN(EaseOut);
-};
-
-// Starts with EaseIn and finishes with EaseOut.
-class EaseInOut : public Easing {
- public:
- explicit EaseInOut(double power);
- double CalculateValueImpl(double input) override;
-
- private:
- EaseIn ease_in_;
- DISALLOW_COPY_AND_ASSIGN(EaseInOut);
-};
-
-} // namespace easing
-} // namespace vr_shell
-
-#endif // CHROME_BROWSER_ANDROID_VR_SHELL_EASING_H_
« no previous file with comments | « chrome/browser/android/vr_shell/animation.cc ('k') | chrome/browser/android/vr_shell/easing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698