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

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

Issue 1894023002: CC Animation: Make ElementAnimations a ref-counted object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
« no previous file with comments | « cc/animation/element_animations_unittest.cc ('k') | no next file » | 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 "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "cc/animation/animation_events.h" 8 #include "cc/animation/animation_events.h"
9 #include "cc/animation/animation_id_provider.h" 9 #include "cc/animation/animation_id_provider.h"
10 #include "cc/animation/animation_player.h" 10 #include "cc/animation/animation_player.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 host_impl_->AnimateLayers(time); 239 host_impl_->AnimateLayers(time);
240 host_impl_->UpdateAnimationState(true, events.get()); 240 host_impl_->UpdateAnimationState(true, events.get());
241 EXPECT_EQ(expect_events, events->events_.size()); 241 EXPECT_EQ(expect_events, events->events_.size());
242 242
243 host_->AnimateLayers(time); 243 host_->AnimateLayers(time);
244 host_->UpdateAnimationState(true, nullptr); 244 host_->UpdateAnimationState(true, nullptr);
245 host_->SetAnimationEvents(std::move(events)); 245 host_->SetAnimationEvents(std::move(events));
246 } 246 }
247 247
248 AnimationPlayer* AnimationTimelinesTest::GetPlayerForLayerId(int layer_id) { 248 AnimationPlayer* AnimationTimelinesTest::GetPlayerForLayerId(int layer_id) {
249 const ElementAnimations* element_animations = 249 const scoped_refptr<ElementAnimations> element_animations =
250 host_->GetElementAnimationsForLayerId(layer_id); 250 host_->GetElementAnimationsForLayerId(layer_id);
251 return element_animations ? element_animations->players_list().head()->value() 251 return element_animations ? element_animations->players_list().head()->value()
252 : nullptr; 252 : nullptr;
253 } 253 }
254 254
255 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) { 255 AnimationPlayer* AnimationTimelinesTest::GetImplPlayerForLayerId(int layer_id) {
256 const ElementAnimations* element_animations = 256 const scoped_refptr<ElementAnimations> element_animations =
257 host_impl_->GetElementAnimationsForLayerId(layer_id); 257 host_impl_->GetElementAnimationsForLayerId(layer_id);
258 return element_animations ? element_animations->players_list().head()->value() 258 return element_animations ? element_animations->players_list().head()->value()
259 : nullptr; 259 : nullptr;
260 } 260 }
261 261
262 int AnimationTimelinesTest::NextTestLayerId() { 262 int AnimationTimelinesTest::NextTestLayerId() {
263 next_test_layer_id_++; 263 next_test_layer_id_++;
264 return next_test_layer_id_; 264 return next_test_layer_id_;
265 } 265 }
266 266
267 } // namespace cc 267 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/element_animations_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698