| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2546 grand_child_of_rs1->SetBounds(gfx::Size(10, 10)); | 2546 grand_child_of_rs1->SetBounds(gfx::Size(10, 10)); |
| 2547 grand_child_of_rs1->test_properties()->transform_origin = | 2547 grand_child_of_rs1->test_properties()->transform_origin = |
| 2548 gfx::Point3F(0.25f, 0.f, 0.f); | 2548 gfx::Point3F(0.25f, 0.f, 0.f); |
| 2549 grand_child_of_rs2->test_properties()->transform = layer_transform; | 2549 grand_child_of_rs2->test_properties()->transform = layer_transform; |
| 2550 grand_child_of_rs2->SetPosition(gfx::PointF(2.5f, 0.f)); | 2550 grand_child_of_rs2->SetPosition(gfx::PointF(2.5f, 0.f)); |
| 2551 grand_child_of_rs2->SetBounds(gfx::Size(10, 10)); | 2551 grand_child_of_rs2->SetBounds(gfx::Size(10, 10)); |
| 2552 grand_child_of_rs2->test_properties()->transform_origin = | 2552 grand_child_of_rs2->test_properties()->transform_origin = |
| 2553 gfx::Point3F(0.25f, 0.f, 0.f); | 2553 gfx::Point3F(0.25f, 0.f, 0.f); |
| 2554 | 2554 |
| 2555 root->layer_tree_impl()->BuildLayerListAndPropertyTreesForTesting(); | 2555 root->layer_tree_impl()->BuildLayerListAndPropertyTreesForTesting(); |
| 2556 SetElementIdsForTesting(); | |
| 2557 | 2556 |
| 2558 // Put an animated opacity on the render surface. | 2557 // Put an animated opacity on the render surface. |
| 2559 AddOpacityTransitionToElementWithPlayer( | 2558 AddOpacityTransitionToElementWithPlayer( |
| 2560 render_surface1->element_id(), timeline_impl(), 10.0, 1.f, 0.f, false); | 2559 render_surface1->element_id(), timeline_impl(), 10.0, 1.f, 0.f, false); |
| 2561 | 2560 |
| 2562 // Also put an animated opacity on a layer without descendants. | 2561 // Also put an animated opacity on a layer without descendants. |
| 2563 AddOpacityTransitionToElementWithPlayer(grand_child_of_root->element_id(), | 2562 AddOpacityTransitionToElementWithPlayer(grand_child_of_root->element_id(), |
| 2564 timeline_impl(), 10.0, 1.f, 0.f, | 2563 timeline_impl(), 10.0, 1.f, 0.f, |
| 2565 false); | 2564 false); |
| 2566 | 2565 |
| (...skipping 2499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5066 const int child_id = child->id(); | 5065 const int child_id = child->id(); |
| 5067 root->test_properties()->AddChild(std::move(child)); | 5066 root->test_properties()->AddChild(std::move(child)); |
| 5068 LayerImpl* root_layer = root.get(); | 5067 LayerImpl* root_layer = root.get(); |
| 5069 host_impl.pending_tree()->SetRootLayerForTesting(std::move(root)); | 5068 host_impl.pending_tree()->SetRootLayerForTesting(std::move(root)); |
| 5070 host_impl.pending_tree()->BuildLayerListAndPropertyTreesForTesting(); | 5069 host_impl.pending_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| 5071 | 5070 |
| 5072 // Add opacity animation. | 5071 // Add opacity animation. |
| 5073 scoped_refptr<AnimationTimeline> timeline = | 5072 scoped_refptr<AnimationTimeline> timeline = |
| 5074 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); | 5073 AnimationTimeline::Create(AnimationIdProvider::NextTimelineId()); |
| 5075 host_impl.animation_host()->AddAnimationTimeline(timeline); | 5074 host_impl.animation_host()->AddAnimationTimeline(timeline); |
| 5076 host_impl.pending_tree()->SetElementIdsForTesting(); | |
| 5077 | 5075 |
| 5078 ElementId child_element_id = | 5076 ElementId child_element_id = |
| 5079 host_impl.pending_tree()->LayerById(child_id)->element_id(); | 5077 host_impl.pending_tree()->LayerById(child_id)->element_id(); |
| 5080 | 5078 |
| 5081 AddOpacityTransitionToElementWithPlayer(child_element_id, timeline, 10.0, | 5079 AddOpacityTransitionToElementWithPlayer(child_element_id, timeline, 10.0, |
| 5082 0.0f, 1.0f, false); | 5080 0.0f, 1.0f, false); |
| 5083 | 5081 |
| 5084 LayerImplList render_surface_layer_list; | 5082 LayerImplList render_surface_layer_list; |
| 5085 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( | 5083 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( |
| 5086 root_layer, root_layer->bounds(), &render_surface_layer_list); | 5084 root_layer, root_layer->bounds(), &render_surface_layer_list); |
| (...skipping 5704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10791 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10789 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
| 10792 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10790 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
| 10793 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10791 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
| 10794 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10792 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
| 10795 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10793 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
| 10796 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10794 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
| 10797 } | 10795 } |
| 10798 | 10796 |
| 10799 } // namespace | 10797 } // namespace |
| 10800 } // namespace cc | 10798 } // namespace cc |
| OLD | NEW |