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

Unified Diff: cc/test/animation_test_common.h

Issue 1882733005: CC Animation: Make LayerAnimationController to have just one value observer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@privatelac
Patch Set: Created 4 years, 8 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
Index: cc/test/animation_test_common.h
diff --git a/cc/test/animation_test_common.h b/cc/test/animation_test_common.h
index b63010e1e9754db0e86cf9c810b7999f30114966..048b597b3a3bef8d842f11c5e5817debae51a9b5 100644
--- a/cc/test/animation_test_common.h
+++ b/cc/test/animation_test_common.h
@@ -81,14 +81,17 @@ class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver {
FakeLayerAnimationValueObserver();
~FakeLayerAnimationValueObserver() override;
- // LayerAnimationValueObserver implementation
- void OnFilterAnimated(const FilterOperations& filters) override;
- void OnOpacityAnimated(float opacity) override;
- void OnTransformAnimated(const gfx::Transform& transform) override;
- void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override;
+ // LayerAnimationValueObserver implementation.
+ void OnFilterAnimated(LayerTreeType tree_type,
+ const FilterOperations& filters) override;
+ void OnOpacityAnimated(LayerTreeType tree_type, float opacity) override;
+ void OnTransformAnimated(LayerTreeType tree_type,
+ const gfx::Transform& transform) override;
+ void OnScrollOffsetAnimated(LayerTreeType tree_type,
+ const gfx::ScrollOffset& scroll_offset) override;
void OnAnimationWaitingForDeletion() override;
- void OnTransformIsPotentiallyAnimatingChanged(bool is_animating) override;
- bool IsActive() const override;
+ void OnTransformIsPotentiallyAnimatingChanged(LayerTreeType tree_type,
+ bool is_animating) override;
const FilterOperations& filters() const { return filters_; }
float opacity() const { return opacity_; }
@@ -110,10 +113,54 @@ class FakeLayerAnimationValueObserver : public LayerAnimationValueObserver {
bool transform_is_animating_;
};
-class FakeInactiveLayerAnimationValueObserver
- : public FakeLayerAnimationValueObserver {
+class FakeTypedLayerAnimationValueObserver
ajuma 2016/04/14 14:01:18 Instead of having two fake observers types, can we
loyso (OOO) 2016/04/15 03:32:21 The observer (and any observations-related stuff)
loyso (OOO) 2016/04/15 03:53:27 Done.
+ : public LayerAnimationValueObserver {
public:
- bool IsActive() const override;
+ FakeTypedLayerAnimationValueObserver();
+ ~FakeTypedLayerAnimationValueObserver() override;
+
+ // LayerAnimationValueObserver implementation.
+ void OnFilterAnimated(LayerTreeType tree_type,
+ const FilterOperations& filters) override;
+ void OnOpacityAnimated(LayerTreeType tree_type, float opacity) override;
+ void OnTransformAnimated(LayerTreeType tree_type,
+ const gfx::Transform& transform) override;
+ void OnScrollOffsetAnimated(LayerTreeType tree_type,
+ const gfx::ScrollOffset& scroll_offset) override;
+ void OnAnimationWaitingForDeletion() override;
+ void OnTransformIsPotentiallyAnimatingChanged(LayerTreeType tree_type,
+ bool is_animating) override;
+
+ const FilterOperations& filters(LayerTreeType tree_type) const {
+ return filters_[ToIndex(tree_type)];
+ }
+ float opacity(LayerTreeType tree_type) const {
+ return opacity_[ToIndex(tree_type)];
+ }
+ const gfx::Transform& transform(LayerTreeType tree_type) const {
+ return transform_[ToIndex(tree_type)];
+ }
+ gfx::ScrollOffset scroll_offset(LayerTreeType tree_type) {
+ return scroll_offset_[ToIndex(tree_type)];
+ }
+
+ bool animation_waiting_for_deletion() {
+ return animation_waiting_for_deletion_;
+ }
+
+ bool transform_is_animating(LayerTreeType tree_type) {
+ return transform_is_animating_[ToIndex(tree_type)];
+ }
+
+ private:
+ static int ToIndex(LayerTreeType tree_type);
+
+ FilterOperations filters_[2];
+ float opacity_[2];
+ gfx::Transform transform_[2];
+ gfx::ScrollOffset scroll_offset_[2];
+ bool animation_waiting_for_deletion_;
+ bool transform_is_animating_[2];
};
class FakeLayerAnimationValueProvider : public LayerAnimationValueProvider {

Powered by Google App Engine
This is Rietveld 408576698