OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "cc/animation/animation_curve.h" | 9 #include "cc/animation/animation_curve.h" |
10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
11 #include "cc/animation/animation_id_provider.h" | 11 #include "cc/animation/animation_id_provider.h" |
12 #include "cc/animation/animation_player.h" | 12 #include "cc/animation/animation_player.h" |
13 #include "cc/animation/animation_timeline.h" | 13 #include "cc/animation/animation_timeline.h" |
14 #include "cc/animation/element_animations.h" | 14 #include "cc/animation/element_animations.h" |
15 #include "cc/animation/scroll_offset_animation_curve.h" | 15 #include "cc/animation/scroll_offset_animation_curve.h" |
16 #include "cc/animation/scroll_offset_animations.h" | 16 #include "cc/animation/scroll_offset_animations.h" |
17 #include "cc/animation/timing_function.h" | 17 #include "cc/animation/timing_function.h" |
18 #include "cc/animation/transform_operations.h" | 18 #include "cc/animation/transform_operations.h" |
19 #include "cc/base/completion_event.h" | 19 #include "cc/base/completion_event.h" |
20 #include "cc/base/time_util.h" | 20 #include "cc/base/time_util.h" |
21 #include "cc/layers/layer.h" | 21 #include "cc/layers/layer.h" |
22 #include "cc/layers/layer_impl.h" | 22 #include "cc/layers/layer_impl.h" |
23 #include "cc/test/animation_test_common.h" | 23 #include "cc/test/animation_test_common.h" |
24 #include "cc/test/fake_content_layer_client.h" | 24 #include "cc/test/fake_content_layer_client.h" |
25 #include "cc/test/fake_picture_layer.h" | 25 #include "cc/test/fake_picture_layer.h" |
26 #include "cc/test/layer_tree_test.h" | 26 #include "cc/test/layer_tree_test.h" |
27 #include "cc/trees/layer_tree_impl.h" | 27 #include "cc/trees/layer_tree_impl.h" |
| 28 #include "cc/trees/transform_node.h" |
28 | 29 |
29 namespace cc { | 30 namespace cc { |
30 namespace { | 31 namespace { |
31 | 32 |
32 class LayerTreeHostAnimationTest : public LayerTreeTest { | 33 class LayerTreeHostAnimationTest : public LayerTreeTest { |
33 public: | 34 public: |
34 LayerTreeHostAnimationTest() | 35 LayerTreeHostAnimationTest() |
35 : timeline_id_(AnimationIdProvider::NextTimelineId()), | 36 : timeline_id_(AnimationIdProvider::NextTimelineId()), |
36 player_id_(AnimationIdProvider::NextPlayerId()), | 37 player_id_(AnimationIdProvider::NextPlayerId()), |
37 player_child_id_(AnimationIdProvider::NextPlayerId()) { | 38 player_child_id_(AnimationIdProvider::NextPlayerId()) { |
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1679 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { | 1680 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override { |
1680 PropertyTrees* property_trees = host_impl->sync_tree()->property_trees(); | 1681 PropertyTrees* property_trees = host_impl->sync_tree()->property_trees(); |
1681 TransformNode* node = | 1682 TransformNode* node = |
1682 property_trees->transform_tree.Node(host_impl->sync_tree() | 1683 property_trees->transform_tree.Node(host_impl->sync_tree() |
1683 ->root_layer_for_testing() | 1684 ->root_layer_for_testing() |
1684 ->transform_tree_index()); | 1685 ->transform_tree_index()); |
1685 gfx::Transform translate; | 1686 gfx::Transform translate; |
1686 translate.Translate(5, 5); | 1687 translate.Translate(5, 5); |
1687 switch (host_impl->sync_tree()->source_frame_number()) { | 1688 switch (host_impl->sync_tree()->source_frame_number()) { |
1688 case 2: | 1689 case 2: |
1689 EXPECT_TRANSFORMATION_MATRIX_EQ(node->data.local, translate); | 1690 EXPECT_TRANSFORMATION_MATRIX_EQ(node->local, translate); |
1690 EndTest(); | 1691 EndTest(); |
1691 break; | 1692 break; |
1692 default: | 1693 default: |
1693 break; | 1694 break; |
1694 } | 1695 } |
1695 } | 1696 } |
1696 | 1697 |
1697 void DidCommit() override { PostSetNeedsCommitToMainThread(); } | 1698 void DidCommit() override { PostSetNeedsCommitToMainThread(); } |
1698 | 1699 |
1699 void WillBeginMainFrame() override { | 1700 void WillBeginMainFrame() override { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 private: | 1845 private: |
1845 scoped_refptr<Layer> layer_; | 1846 scoped_refptr<Layer> layer_; |
1846 FakeContentLayerClient client_; | 1847 FakeContentLayerClient client_; |
1847 }; | 1848 }; |
1848 | 1849 |
1849 MULTI_THREAD_TEST_F( | 1850 MULTI_THREAD_TEST_F( |
1850 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); | 1851 LayerTreeHostAnimationTestRebuildPropertyTreesOnAnimationSetNeedsCommit); |
1851 | 1852 |
1852 } // namespace | 1853 } // namespace |
1853 } // namespace cc | 1854 } // namespace cc |
OLD | NEW |