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 #ifndef CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ | 5 #ifndef CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ |
6 #define CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ | 6 #define CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <unordered_map> | 9 #include <unordered_map> |
10 | 10 |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 ElementListType list_type, | 185 ElementListType list_type, |
186 int transform_x, | 186 int transform_x, |
187 int transform_y) const; | 187 int transform_y) const; |
188 | 188 |
189 TestLayer* FindTestLayer(ElementId element_id, | 189 TestLayer* FindTestLayer(ElementId element_id, |
190 ElementListType list_type) const; | 190 ElementListType list_type) const; |
191 | 191 |
192 private: | 192 private: |
193 std::unique_ptr<AnimationHost> host_; | 193 std::unique_ptr<AnimationHost> host_; |
194 | 194 |
195 using LayerIdToTestLayer = | 195 using ElementIdToTestLayer = |
196 std::unordered_map<int, std::unique_ptr<TestLayer>>; | 196 std::unordered_map<ElementId, std::unique_ptr<TestLayer>, ElementIdHash>; |
197 LayerIdToTestLayer layers_in_active_tree_; | 197 ElementIdToTestLayer layers_in_active_tree_; |
198 LayerIdToTestLayer layers_in_pending_tree_; | 198 ElementIdToTestLayer layers_in_pending_tree_; |
199 | 199 |
200 gfx::ScrollOffset scroll_offset_; | 200 gfx::ScrollOffset scroll_offset_; |
201 bool mutators_need_commit_; | 201 bool mutators_need_commit_; |
202 }; | 202 }; |
203 | 203 |
204 class TestAnimationDelegate : public AnimationDelegate { | 204 class TestAnimationDelegate : public AnimationDelegate { |
205 public: | 205 public: |
206 TestAnimationDelegate(); | 206 TestAnimationDelegate(); |
207 | 207 |
208 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 208 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 void CreateTestImplLayer(ElementListType element_list_type); | 257 void CreateTestImplLayer(ElementListType element_list_type); |
258 | 258 |
259 scoped_refptr<ElementAnimations> element_animations() const; | 259 scoped_refptr<ElementAnimations> element_animations() const; |
260 scoped_refptr<ElementAnimations> element_animations_impl() const; | 260 scoped_refptr<ElementAnimations> element_animations_impl() const; |
261 | 261 |
262 void ReleaseRefPtrs(); | 262 void ReleaseRefPtrs(); |
263 | 263 |
264 void AnimateLayersTransferEvents(base::TimeTicks time, | 264 void AnimateLayersTransferEvents(base::TimeTicks time, |
265 unsigned expect_events); | 265 unsigned expect_events); |
266 | 266 |
267 AnimationPlayer* GetPlayerForLayerId(ElementId element_id); | 267 AnimationPlayer* GetPlayerForElementId(ElementId element_id); |
268 AnimationPlayer* GetImplPlayerForLayerId(ElementId element_id); | 268 AnimationPlayer* GetImplPlayerForLayerId(ElementId element_id); |
269 | 269 |
270 int NextTestLayerId(); | 270 int NextTestLayerId(); |
271 | 271 |
272 TestHostClient client_; | 272 TestHostClient client_; |
273 TestHostClient client_impl_; | 273 TestHostClient client_impl_; |
274 | 274 |
275 AnimationHost* host_; | 275 AnimationHost* host_; |
276 AnimationHost* host_impl_; | 276 AnimationHost* host_impl_; |
277 | 277 |
278 const int timeline_id_; | 278 const int timeline_id_; |
279 const int player_id_; | 279 const int player_id_; |
280 int element_id_; | 280 ElementId element_id_; |
281 | 281 |
282 int next_test_layer_id_; | 282 int next_test_layer_id_; |
283 | 283 |
284 scoped_refptr<AnimationTimeline> timeline_; | 284 scoped_refptr<AnimationTimeline> timeline_; |
285 scoped_refptr<AnimationPlayer> player_; | 285 scoped_refptr<AnimationPlayer> player_; |
286 | 286 |
287 scoped_refptr<AnimationTimeline> timeline_impl_; | 287 scoped_refptr<AnimationTimeline> timeline_impl_; |
288 scoped_refptr<AnimationPlayer> player_impl_; | 288 scoped_refptr<AnimationPlayer> player_impl_; |
289 }; | 289 }; |
290 | 290 |
291 } // namespace cc | 291 } // namespace cc |
292 | 292 |
293 #endif // CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ | 293 #endif // CC_TEST_ANIMATION_TIMELINES_TEST_COMMON_H_ |
OLD | NEW |