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

Side by Side Diff: cc/animation/animation_player_unittest.cc

Issue 1009233002: CC Animations: Port Impl-only-scrolling to use compositor animation timelines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui
Patch Set: Add unittests. Created 5 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 unified diff | Download patch
« no previous file with comments | « cc/animation/animation_player.cc ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/animation/animation_player.h" 5 #include "cc/animation/animation_player.h"
6 6
7 #include "base/containers/hash_tables.h" 7 #include "base/containers/hash_tables.h"
8 #include "cc/animation/animation_delegate.h" 8 #include "cc/animation/animation_delegate.h"
9 #include "cc/animation/animation_host.h" 9 #include "cc/animation/animation_host.h"
10 #include "cc/animation/animation_registrar.h" 10 #include "cc/animation/animation_registrar.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 float opacity) override { 72 float opacity) override {
73 SetLayerMutated(layer_id, active_tree, Animation::OPACITY); 73 SetLayerMutated(layer_id, active_tree, Animation::OPACITY);
74 } 74 }
75 75
76 void SetLayerTransformMutated(int layer_id, 76 void SetLayerTransformMutated(int layer_id,
77 bool active_tree, 77 bool active_tree,
78 const gfx::Transform& transform) override { 78 const gfx::Transform& transform) override {
79 SetLayerMutated(layer_id, active_tree, Animation::TRANSFORM); 79 SetLayerMutated(layer_id, active_tree, Animation::TRANSFORM);
80 } 80 }
81 81
82 void ScrollOffsetAnimationFinished() override {}
83 gfx::ScrollOffset GetScrollOffsetForAnimation(int layer_id) const override {
84 return gfx::ScrollOffset();
85 }
86
82 void SetLayerScrollOffsetMutated( 87 void SetLayerScrollOffsetMutated(
83 int layer_id, 88 int layer_id,
84 bool active_tree, 89 bool active_tree,
85 const gfx::ScrollOffset& scroll_offset) override { 90 const gfx::ScrollOffset& scroll_offset) override {
86 SetLayerMutated(layer_id, active_tree, Animation::SCROLL_OFFSET); 91 SetLayerMutated(layer_id, active_tree, Animation::SCROLL_OFFSET);
87 } 92 }
88 93
89 bool mutators_need_commit() const { return mutators_need_commit_; } 94 bool mutators_need_commit() const { return mutators_need_commit_; }
90 void set_mutators_need_commit(bool need) { mutators_need_commit_ = need; } 95 void set_mutators_need_commit(bool need) { mutators_need_commit_ = need; }
91 96
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 EXPECT_TRUE(client_.mutators_need_commit()); 483 EXPECT_TRUE(client_.mutators_need_commit());
479 client_.set_mutators_need_commit(false); 484 client_.set_mutators_need_commit(false);
480 485
481 player_->RemoveAnimation(animation_id); 486 player_->RemoveAnimation(animation_id);
482 EXPECT_TRUE(client_.mutators_need_commit()); 487 EXPECT_TRUE(client_.mutators_need_commit());
483 client_.set_mutators_need_commit(false); 488 client_.set_mutators_need_commit(false);
484 } 489 }
485 490
486 } // namespace 491 } // namespace
487 } // namespace cc 492 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/animation_player.cc ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698