| 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 <set> | 10 #include <set> |
| (...skipping 9306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9317 gfx::PointF(), gfx::Size(30, 30), true, false, | 9317 gfx::PointF(), gfx::Size(30, 30), true, false, |
| 9318 true); | 9318 true); |
| 9319 SetLayerPropertiesForTesting(test_layer, identity_matrix, gfx::Point3F(), | 9319 SetLayerPropertiesForTesting(test_layer, identity_matrix, gfx::Point3F(), |
| 9320 gfx::PointF(), gfx::Size(30, 30), true, false, | 9320 gfx::PointF(), gfx::Size(30, 30), true, false, |
| 9321 false); | 9321 false); |
| 9322 | 9322 |
| 9323 ExecuteCalculateDrawProperties(root); | 9323 ExecuteCalculateDrawProperties(root); |
| 9324 | 9324 |
| 9325 EXPECT_TRUE(test_layer->is_clipped()); | 9325 EXPECT_TRUE(test_layer->is_clipped()); |
| 9326 EXPECT_FALSE(test_layer->render_target()->render_surface()->is_clipped()); | 9326 EXPECT_FALSE(test_layer->render_target()->render_surface()->is_clipped()); |
| 9327 EXPECT_EQ(gfx::Rect(-2, -2, 28, 28), test_layer->clip_rect()); | 9327 EXPECT_EQ(gfx::Rect(-2, -2, 30, 30), test_layer->clip_rect()); |
| 9328 EXPECT_EQ(gfx::Rect(26, 26), test_layer->drawable_content_rect()); | 9328 EXPECT_EQ(gfx::Rect(28, 28), test_layer->drawable_content_rect()); |
| 9329 } | 9329 } |
| 9330 | 9330 |
| 9331 TEST_F(LayerTreeHostCommonTest, | 9331 TEST_F(LayerTreeHostCommonTest, |
| 9332 RenderSurfaceWithUnclippedDescendantsButDoesntApplyOwnClip) { | 9332 RenderSurfaceWithUnclippedDescendantsButDoesntApplyOwnClip) { |
| 9333 // Ensure that the visible layer rect of a descendant of a surface with | 9333 // Ensure that the visible layer rect of a descendant of a surface with |
| 9334 // unclipped descendants is computed correctly, when the surface doesn't apply | 9334 // unclipped descendants is computed correctly, when the surface doesn't apply |
| 9335 // a clip. | 9335 // a clip. |
| 9336 LayerImpl* root = root_layer(); | 9336 LayerImpl* root = root_layer(); |
| 9337 LayerImpl* clip_parent = AddChildToRoot<LayerImpl>(); | 9337 LayerImpl* clip_parent = AddChildToRoot<LayerImpl>(); |
| 9338 LayerImpl* render_surface = AddChild<LayerImpl>(clip_parent); | 9338 LayerImpl* render_surface = AddChild<LayerImpl>(clip_parent); |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10063 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); | 10063 EXPECT_EQ(scroll_child6.id, grand_child10->scroll_tree_index()); |
| 10064 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); | 10064 EXPECT_EQ(scroll_root1.id, parent3->scroll_tree_index()); |
| 10065 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); | 10065 EXPECT_EQ(scroll_child7.id, child8->scroll_tree_index()); |
| 10066 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); | 10066 EXPECT_EQ(scroll_root1.id, parent4->scroll_tree_index()); |
| 10067 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); | 10067 EXPECT_EQ(scroll_root1.id, child9->scroll_tree_index()); |
| 10068 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); | 10068 EXPECT_EQ(scroll_root1.id, grand_child12->scroll_tree_index()); |
| 10069 } | 10069 } |
| 10070 | 10070 |
| 10071 } // namespace | 10071 } // namespace |
| 10072 } // namespace cc | 10072 } // namespace cc |
| OLD | NEW |