OLD | NEW |
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 "cc/animation/animation_events.h" | 8 #include "cc/animation/animation_events.h" |
8 #include "cc/animation/animation_id_provider.h" | 9 #include "cc/animation/animation_id_provider.h" |
9 #include "cc/animation/animation_player.h" | 10 #include "cc/animation/animation_player.h" |
10 #include "cc/animation/animation_registrar.h" | 11 #include "cc/animation/animation_registrar.h" |
11 #include "cc/animation/animation_timeline.h" | 12 #include "cc/animation/animation_timeline.h" |
12 #include "cc/animation/element_animations.h" | 13 #include "cc/animation/element_animations.h" |
13 #include "cc/output/filter_operation.h" | 14 #include "cc/output/filter_operation.h" |
14 #include "cc/output/filter_operations.h" | 15 #include "cc/output/filter_operations.h" |
15 #include "ui/gfx/transform.h" | 16 #include "ui/gfx/transform.h" |
16 | 17 |
17 namespace cc { | 18 namespace cc { |
18 | 19 |
19 scoped_ptr<TestLayer> TestLayer::Create() { | 20 std::unique_ptr<TestLayer> TestLayer::Create() { |
20 return make_scoped_ptr(new TestLayer()); | 21 return base::WrapUnique(new TestLayer()); |
21 } | 22 } |
22 | 23 |
23 TestLayer::TestLayer() { | 24 TestLayer::TestLayer() { |
24 ClearMutatedProperties(); | 25 ClearMutatedProperties(); |
25 } | 26 } |
26 | 27 |
27 void TestLayer::ClearMutatedProperties() { | 28 void TestLayer::ClearMutatedProperties() { |
28 transform_x_ = 0; | 29 transform_x_ = 0; |
29 transform_y_ = 0; | 30 transform_y_ = 0; |
30 | 31 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 void AnimationTimelinesTest::ReleaseRefPtrs() { | 228 void AnimationTimelinesTest::ReleaseRefPtrs() { |
228 player_ = nullptr; | 229 player_ = nullptr; |
229 timeline_ = nullptr; | 230 timeline_ = nullptr; |
230 player_impl_ = nullptr; | 231 player_impl_ = nullptr; |
231 timeline_impl_ = nullptr; | 232 timeline_impl_ = nullptr; |
232 } | 233 } |
233 | 234 |
234 void AnimationTimelinesTest::AnimateLayersTransferEvents( | 235 void AnimationTimelinesTest::AnimateLayersTransferEvents( |
235 base::TimeTicks time, | 236 base::TimeTicks time, |
236 unsigned expect_events) { | 237 unsigned expect_events) { |
237 scoped_ptr<AnimationEvents> events = | 238 std::unique_ptr<AnimationEvents> events = |
238 host_->animation_registrar()->CreateEvents(); | 239 host_->animation_registrar()->CreateEvents(); |
239 | 240 |
240 host_impl_->animation_registrar()->AnimateLayers(time); | 241 host_impl_->animation_registrar()->AnimateLayers(time); |
241 host_impl_->animation_registrar()->UpdateAnimationState(true, events.get()); | 242 host_impl_->animation_registrar()->UpdateAnimationState(true, events.get()); |
242 EXPECT_EQ(expect_events, events->events_.size()); | 243 EXPECT_EQ(expect_events, events->events_.size()); |
243 | 244 |
244 host_->animation_registrar()->AnimateLayers(time); | 245 host_->animation_registrar()->AnimateLayers(time); |
245 host_->animation_registrar()->UpdateAnimationState(true, nullptr); | 246 host_->animation_registrar()->UpdateAnimationState(true, nullptr); |
246 host_->animation_registrar()->SetAnimationEvents(std::move(events)); | 247 host_->animation_registrar()->SetAnimationEvents(std::move(events)); |
247 } | 248 } |
(...skipping 11 matching lines...) Expand all Loading... |
259 return element_animations ? element_animations->players_list().head()->value() | 260 return element_animations ? element_animations->players_list().head()->value() |
260 : nullptr; | 261 : nullptr; |
261 } | 262 } |
262 | 263 |
263 int AnimationTimelinesTest::NextTestLayerId() { | 264 int AnimationTimelinesTest::NextTestLayerId() { |
264 next_test_layer_id_++; | 265 next_test_layer_id_++; |
265 return next_test_layer_id_; | 266 return next_test_layer_id_; |
266 } | 267 } |
267 | 268 |
268 } // namespace cc | 269 } // namespace cc |
OLD | NEW |