summaryrefslogtreecommitdiffstats
path: root/cc/test/animation_test_common.h
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-12 19:40:56 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-12 19:40:56 +0000
commitc79f147c0474a311a83829a44b55aaffa42c6237 (patch)
tree8bb41fcb74068042828da31c279b0d53dd0844fa /cc/test/animation_test_common.h
parente62f2909e0aabf37131a65c7e50e85c1f07473f8 (diff)
downloadchromium_src-c79f147c0474a311a83829a44b55aaffa42c6237.zip
chromium_src-c79f147c0474a311a83829a44b55aaffa42c6237.tar.gz
chromium_src-c79f147c0474a311a83829a44b55aaffa42c6237.tar.bz2
[cc] Change cc_tests.gyp filenames to Chromium style
BUG=155413 Review URL: https://codereview.chromium.org/11108020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/animation_test_common.h')
-rw-r--r--cc/test/animation_test_common.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/cc/test/animation_test_common.h b/cc/test/animation_test_common.h
index 638cbb2..a768930 100644
--- a/cc/test/animation_test_common.h
+++ b/cc/test/animation_test_common.h
@@ -1,3 +1,92 @@
// Copyright 2012 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 CCAnimationTestCommon_h
+#define CCAnimationTestCommon_h
+
+#include "CCActiveAnimation.h"
+#include "CCAnimationCurve.h"
+#include "CCLayerAnimationController.h"
+#include "IntSize.h"
+
+namespace cc {
+class CCLayerImpl;
+class LayerChromium;
+}
+
+namespace WebKitTests {
+
+class FakeFloatAnimationCurve : public cc::CCFloatAnimationCurve {
+public:
+ FakeFloatAnimationCurve();
+ explicit FakeFloatAnimationCurve(double duration);
+ virtual ~FakeFloatAnimationCurve();
+
+ virtual double duration() const OVERRIDE;
+ virtual float getValue(double now) const OVERRIDE;
+ virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE;
+
+private:
+ double m_duration;
+};
+
+class FakeTransformTransition : public cc::CCTransformAnimationCurve {
+public:
+ FakeTransformTransition(double duration);
+ virtual ~FakeTransformTransition();
+
+ virtual double duration() const OVERRIDE;
+ virtual WebKit::WebTransformationMatrix getValue(double time) const OVERRIDE;
+
+ virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE;
+
+private:
+ double m_duration;
+};
+
+class FakeFloatTransition : public cc::CCFloatAnimationCurve {
+public:
+ FakeFloatTransition(double duration, float from, float to);
+ virtual ~FakeFloatTransition();
+
+ virtual double duration() const OVERRIDE;
+ virtual float getValue(double time) const OVERRIDE;
+
+ virtual scoped_ptr<cc::CCAnimationCurve> clone() const OVERRIDE;
+
+private:
+ double m_duration;
+ float m_from;
+ float m_to;
+};
+
+class FakeLayerAnimationControllerClient : public cc::CCLayerAnimationControllerClient {
+public:
+ FakeLayerAnimationControllerClient();
+ virtual ~FakeLayerAnimationControllerClient();
+
+ // CCLayerAnimationControllerClient implementation
+ virtual int id() const OVERRIDE;
+ virtual void setOpacityFromAnimation(float) OVERRIDE;
+ virtual float opacity() const OVERRIDE;
+ virtual void setTransformFromAnimation(const WebKit::WebTransformationMatrix&) OVERRIDE;
+ virtual const WebKit::WebTransformationMatrix& transform() const OVERRIDE;
+
+private:
+ float m_opacity;
+ WebKit::WebTransformationMatrix m_transform;
+};
+
+void addOpacityTransitionToController(cc::CCLayerAnimationController&, double duration, float startOpacity, float endOpacity, bool useTimingFunction);
+void addAnimatedTransformToController(cc::CCLayerAnimationController&, double duration, int deltaX, int deltaY);
+
+void addOpacityTransitionToLayer(cc::LayerChromium&, double duration, float startOpacity, float endOpacity, bool useTimingFunction);
+void addOpacityTransitionToLayer(cc::CCLayerImpl&, double duration, float startOpacity, float endOpacity, bool useTimingFunction);
+
+void addAnimatedTransformToLayer(cc::LayerChromium&, double duration, int deltaX, int deltaY);
+void addAnimatedTransformToLayer(cc::CCLayerImpl&, double duration, int deltaX, int deltaY);
+
+} // namespace WebKitTests
+
+#endif // CCAnimationTesctCommon_h