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

Unified Diff: cc/test/animation_test_common.h

Issue 95763002: cc: Support animating scroll offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « cc/layers/layer_impl.cc ('k') | cc/test/animation_test_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/animation_test_common.h
diff --git a/cc/test/animation_test_common.h b/cc/test/animation_test_common.h
index 008af87d0db3142745a7695e9680e6e2860f61eb..1205bf30929cc90c93e0d4be2bb0f7de66f70fdc 100644
--- a/cc/test/animation_test_common.h
+++ b/cc/test/animation_test_common.h
@@ -9,7 +9,9 @@
#include "cc/animation/animation_curve.h"
#include "cc/animation/layer_animation_controller.h"
#include "cc/animation/layer_animation_value_observer.h"
+#include "cc/animation/layer_animation_value_provider.h"
#include "cc/output/filter_operations.h"
+#include "cc/test/geometry_test_utils.h"
namespace cc {
class LayerImpl;
@@ -73,12 +75,14 @@ class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver {
virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE;
virtual void OnOpacityAnimated(float opacity) OVERRIDE;
virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE;
+ virtual void OnScrollOffsetAnimated(gfx::Vector2dF scroll_offset) OVERRIDE;
virtual void OnAnimationWaitingForDeletion() OVERRIDE;
virtual bool IsActive() const OVERRIDE;
const FilterOperations& filters() const { return filters_; }
float opacity() const { return opacity_; }
const gfx::Transform& transform() const { return transform_; }
+ gfx::Vector2dF scroll_offset() { return scroll_offset_; }
bool animation_waiting_for_deletion() {
return animation_waiting_for_deletion_;
@@ -88,6 +92,7 @@ class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver {
FilterOperations filters_;
float opacity_;
gfx::Transform transform_;
+ gfx::Vector2dF scroll_offset_;
bool animation_waiting_for_deletion_;
};
@@ -97,6 +102,18 @@ class FakeInactiveLayerAnimationValueObserver
virtual bool IsActive() const OVERRIDE;
};
+class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider {
+ public:
+ virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE;
+
+ void set_scroll_offset(gfx::Vector2dF scroll_offset) {
+ scroll_offset_ = scroll_offset;
+ }
+
+ private:
+ gfx::Vector2dF scroll_offset_;
+};
+
int AddOpacityTransitionToController(LayerAnimationController* controller,
double duration,
float start_opacity,
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/test/animation_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698