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 <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 9578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9589 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); | 9589 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
9590 host->SetRootLayer(root); | 9590 host->SetRootLayer(root); |
9591 | 9591 |
9592 EXPECT_EQ(root->num_layer_or_descendants_with_input_handler(), 0); | 9592 EXPECT_EQ(root->num_layer_or_descendants_with_input_handler(), 0); |
9593 ExecuteCalculateDrawProperties(root.get()); | 9593 ExecuteCalculateDrawProperties(root.get()); |
9594 EXPECT_EQ(root->num_layer_or_descendants_with_input_handler(), 1); | 9594 EXPECT_EQ(root->num_layer_or_descendants_with_input_handler(), 1); |
9595 child->SetHaveWheelEventHandlers(false); | 9595 child->SetHaveWheelEventHandlers(false); |
9596 EXPECT_EQ(root->num_layer_or_descendants_with_input_handler(), 0); | 9596 EXPECT_EQ(root->num_layer_or_descendants_with_input_handler(), 0); |
9597 } | 9597 } |
9598 | 9598 |
9599 TEST_F(LayerTreeHostCommonTest, ResetPropertyTreeIndices) { | |
9600 gfx::Transform identity; | |
9601 gfx::Transform translate_z; | |
9602 translate_z.Translate3d(0, 0, 10); | |
9603 | |
9604 scoped_refptr<Layer> root = Layer::Create(); | |
9605 SetLayerPropertiesForTesting(root.get(), identity, gfx::Point3F(), | |
9606 gfx::PointF(), gfx::Size(800, 800), true, false); | |
9607 | |
9608 scoped_refptr<Layer> child = Layer::Create(); | |
9609 SetLayerPropertiesForTesting(child.get(), translate_z, gfx::Point3F(), | |
9610 gfx::PointF(), gfx::Size(100, 100), true, false); | |
9611 | |
9612 root->AddChild(child); | |
9613 | |
9614 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); | |
9615 host->SetRootLayer(root); | |
9616 | |
9617 ExecuteCalculateDrawProperties(root.get()); | |
ajuma
2015/05/19 20:06:23
ExecuteCalculateDrawPropertiesWithPropertyTrees (s
Ian Vollick
2015/05/19 21:11:48
Done.
| |
9618 EXPECT_NE(-1, child->transform_tree_index()); | |
9619 | |
9620 child->RemoveFromParent(); | |
9621 | |
9622 ExecuteCalculateDrawProperties(root.get()); | |
9623 EXPECT_EQ(-1, child->transform_tree_index()); | |
9624 } | |
9625 | |
9599 } // namespace | 9626 } // namespace |
9600 } // namespace cc | 9627 } // namespace cc |
OLD | NEW |