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

Side by Side Diff: cc/test/animation_timelines_test_common.cc

Issue 1413003002: CC Animations: Fix AnimationHost mode integration with Property Trees. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: An attempt to fix weird EXPECT_EQ compilation errors. Created 5 years, 2 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/test/animation_timelines_test_common.h ('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/test/animation_timelines_test_common.h" 5 #include "cc/test/animation_timelines_test_common.h"
6 6
7 #include "cc/animation/animation_events.h" 7 #include "cc/animation/animation_events.h"
8 #include "cc/animation/animation_id_provider.h" 8 #include "cc/animation/animation_id_provider.h"
9 #include "cc/animation/animation_player.h" 9 #include "cc/animation/animation_player.h"
10 #include "cc/animation/animation_registrar.h" 10 #include "cc/animation/animation_registrar.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 LayerTreeType tree_type) const { 56 LayerTreeType tree_type) const {
57 return tree_type == LayerTreeType::ACTIVE 57 return tree_type == LayerTreeType::ACTIVE
58 ? layers_in_active_tree_.count(layer_id) 58 ? layers_in_active_tree_.count(layer_id)
59 : layers_in_pending_tree_.count(layer_id); 59 : layers_in_pending_tree_.count(layer_id);
60 } 60 }
61 61
62 void TestHostClient::SetMutatorsNeedCommit() { 62 void TestHostClient::SetMutatorsNeedCommit() {
63 mutators_need_commit_ = true; 63 mutators_need_commit_ = true;
64 } 64 }
65 65
66 void TestHostClient::SetMutatorsNeedRebuildPropertyTrees() {}
67
66 void TestHostClient::SetLayerFilterMutated(int layer_id, 68 void TestHostClient::SetLayerFilterMutated(int layer_id,
67 LayerTreeType tree_type, 69 LayerTreeType tree_type,
68 const FilterOperations& filters) { 70 const FilterOperations& filters) {
69 for (unsigned i = 0; i < filters.size(); ++i) { 71 for (unsigned i = 0; i < filters.size(); ++i) {
70 const FilterOperation& filter = filters.at(i); 72 const FilterOperation& filter = filters.at(i);
71 if (filter.type() == FilterOperation::BRIGHTNESS) { 73 if (filter.type() == FilterOperation::BRIGHTNESS) {
72 TestLayer* layer = FindTestLayer(layer_id, tree_type); 74 TestLayer* layer = FindTestLayer(layer_id, tree_type);
73 layer->set_brightness(filter.amount()); 75 layer->set_brightness(filter.amount());
74 } 76 }
75 } 77 }
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 212 }
211 213
212 AnimationTimelinesTest::~AnimationTimelinesTest() { 214 AnimationTimelinesTest::~AnimationTimelinesTest() {
213 } 215 }
214 216
215 void AnimationTimelinesTest::SetUp() { 217 void AnimationTimelinesTest::SetUp() {
216 timeline_ = AnimationTimeline::Create(timeline_id_); 218 timeline_ = AnimationTimeline::Create(timeline_id_);
217 player_ = AnimationPlayer::Create(player_id_); 219 player_ = AnimationPlayer::Create(player_id_);
218 } 220 }
219 221
222 void AnimationTimelinesTest::TearDown() {
223 host_impl_->ClearTimelines();
224 host_->ClearTimelines();
225 }
226
220 void AnimationTimelinesTest::GetImplTimelineAndPlayerByID() { 227 void AnimationTimelinesTest::GetImplTimelineAndPlayerByID() {
221 timeline_impl_ = host_impl_->GetTimelineById(timeline_id_); 228 timeline_impl_ = host_impl_->GetTimelineById(timeline_id_);
222 EXPECT_TRUE(timeline_impl_); 229 EXPECT_TRUE(timeline_impl_);
223 player_impl_ = timeline_impl_->GetPlayerById(player_id_); 230 player_impl_ = timeline_impl_->GetPlayerById(player_id_);
224 EXPECT_TRUE(player_impl_); 231 EXPECT_TRUE(player_impl_);
225 } 232 }
226 233
227 void AnimationTimelinesTest::ReleaseRefPtrs() { 234 void AnimationTimelinesTest::ReleaseRefPtrs() {
228 player_ = nullptr; 235 player_ = nullptr;
229 timeline_ = nullptr; 236 timeline_ = nullptr;
(...skipping 24 matching lines...) Expand all
254 } 261 }
255 262
256 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { 263 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) {
257 const ElementAnimations* element_animations = 264 const ElementAnimations* element_animations =
258 host_impl_->GetElementAnimationsForLayerId(layer_id); 265 host_impl_->GetElementAnimationsForLayerId(layer_id);
259 return element_animations ? element_animations->players_list().head()->value() 266 return element_animations ? element_animations->players_list().head()->value()
260 : nullptr; 267 : nullptr;
261 } 268 }
262 269
263 } // namespace cc 270 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/animation_timelines_test_common.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698