| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "cc/animation/layer_animation_controller.h" | 9 #include "cc/animation/layer_animation_controller.h" |
| 10 #include "cc/animation/transform_operations.h" | 10 #include "cc/animation/transform_operations.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // and with identity transforms, then the draw transform, | 112 // and with identity transforms, then the draw transform, |
| 113 // screen space transform, and the hierarchy passed on to children | 113 // screen space transform, and the hierarchy passed on to children |
| 114 // layers should also be identity transforms. | 114 // layers should also be identity transforms. |
| 115 | 115 |
| 116 scoped_refptr<Layer> parent = Layer::Create(); | 116 scoped_refptr<Layer> parent = Layer::Create(); |
| 117 scoped_refptr<Layer> child = Layer::Create(); | 117 scoped_refptr<Layer> child = Layer::Create(); |
| 118 scoped_refptr<Layer> grand_child = Layer::Create(); | 118 scoped_refptr<Layer> grand_child = Layer::Create(); |
| 119 parent->AddChild(child); | 119 parent->AddChild(child); |
| 120 child->AddChild(grand_child); | 120 child->AddChild(grand_child); |
| 121 | 121 |
| 122 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 122 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 123 host->SetRootLayer(parent); | 123 host->SetRootLayer(parent); |
| 124 | 124 |
| 125 gfx::Transform identity_matrix; | 125 gfx::Transform identity_matrix; |
| 126 SetLayerPropertiesForTesting(parent.get(), | 126 SetLayerPropertiesForTesting(parent.get(), |
| 127 identity_matrix, | 127 identity_matrix, |
| 128 gfx::Point3F(), | 128 gfx::Point3F(), |
| 129 gfx::PointF(), | 129 gfx::PointF(), |
| 130 gfx::Size(100, 100), | 130 gfx::Size(100, 100), |
| 131 true, | 131 true, |
| 132 false); | 132 false); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 156 grand_child->screen_space_transform()); | 156 grand_child->screen_space_transform()); |
| 157 } | 157 } |
| 158 | 158 |
| 159 TEST_F(LayerTreeHostCommonTest, DoNotSkipLayersWithHandlers) { | 159 TEST_F(LayerTreeHostCommonTest, DoNotSkipLayersWithHandlers) { |
| 160 scoped_refptr<Layer> parent = Layer::Create(); | 160 scoped_refptr<Layer> parent = Layer::Create(); |
| 161 scoped_refptr<Layer> child = Layer::Create(); | 161 scoped_refptr<Layer> child = Layer::Create(); |
| 162 scoped_refptr<Layer> grand_child = Layer::Create(); | 162 scoped_refptr<Layer> grand_child = Layer::Create(); |
| 163 parent->AddChild(child); | 163 parent->AddChild(child); |
| 164 child->AddChild(grand_child); | 164 child->AddChild(grand_child); |
| 165 | 165 |
| 166 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 166 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 167 host->SetRootLayer(parent); | 167 host->SetRootLayer(parent); |
| 168 | 168 |
| 169 gfx::Transform identity_matrix; | 169 gfx::Transform identity_matrix; |
| 170 SetLayerPropertiesForTesting(parent.get(), | 170 SetLayerPropertiesForTesting(parent.get(), |
| 171 identity_matrix, | 171 identity_matrix, |
| 172 gfx::Point3F(), | 172 gfx::Point3F(), |
| 173 gfx::PointF(), | 173 gfx::PointF(), |
| 174 gfx::Size(100, 100), | 174 gfx::Size(100, 100), |
| 175 true, | 175 true, |
| 176 false); | 176 false); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 scoped_refptr<Layer> root = Layer::Create(); | 209 scoped_refptr<Layer> root = Layer::Create(); |
| 210 SetLayerPropertiesForTesting(root.get(), | 210 SetLayerPropertiesForTesting(root.get(), |
| 211 identity_matrix, | 211 identity_matrix, |
| 212 gfx::Point3F(), | 212 gfx::Point3F(), |
| 213 gfx::PointF(), | 213 gfx::PointF(), |
| 214 gfx::Size(1, 2), | 214 gfx::Size(1, 2), |
| 215 true, | 215 true, |
| 216 false); | 216 false); |
| 217 root->AddChild(layer); | 217 root->AddChild(layer); |
| 218 | 218 |
| 219 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 219 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 220 host->SetRootLayer(root); | 220 host->SetRootLayer(root); |
| 221 | 221 |
| 222 // Case 2: Setting the bounds of the layer should not affect either the draw | 222 // Case 2: Setting the bounds of the layer should not affect either the draw |
| 223 // transform or the screenspace transform. | 223 // transform or the screenspace transform. |
| 224 gfx::Transform translation_to_center; | 224 gfx::Transform translation_to_center; |
| 225 translation_to_center.Translate(5.0, 6.0); | 225 translation_to_center.Translate(5.0, 6.0); |
| 226 SetLayerPropertiesForTesting(layer.get(), | 226 SetLayerPropertiesForTesting(layer.get(), |
| 227 identity_matrix, | 227 identity_matrix, |
| 228 gfx::Point3F(), | 228 gfx::Point3F(), |
| 229 gfx::PointF(), | 229 gfx::PointF(), |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 TEST_F(LayerTreeHostCommonTest, TransformsForSimpleHierarchy) { | 418 TEST_F(LayerTreeHostCommonTest, TransformsForSimpleHierarchy) { |
| 419 gfx::Transform identity_matrix; | 419 gfx::Transform identity_matrix; |
| 420 scoped_refptr<Layer> root = Layer::Create(); | 420 scoped_refptr<Layer> root = Layer::Create(); |
| 421 scoped_refptr<Layer> parent = Layer::Create(); | 421 scoped_refptr<Layer> parent = Layer::Create(); |
| 422 scoped_refptr<Layer> child = Layer::Create(); | 422 scoped_refptr<Layer> child = Layer::Create(); |
| 423 scoped_refptr<Layer> grand_child = Layer::Create(); | 423 scoped_refptr<Layer> grand_child = Layer::Create(); |
| 424 root->AddChild(parent); | 424 root->AddChild(parent); |
| 425 parent->AddChild(child); | 425 parent->AddChild(child); |
| 426 child->AddChild(grand_child); | 426 child->AddChild(grand_child); |
| 427 | 427 |
| 428 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 428 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 429 host->SetRootLayer(root); | 429 host->SetRootLayer(root); |
| 430 | 430 |
| 431 // One-time setup of root layer | 431 // One-time setup of root layer |
| 432 SetLayerPropertiesForTesting(root.get(), | 432 SetLayerPropertiesForTesting(root.get(), |
| 433 identity_matrix, | 433 identity_matrix, |
| 434 gfx::Point3F(), | 434 gfx::Point3F(), |
| 435 gfx::PointF(), | 435 gfx::PointF(), |
| 436 gfx::Size(1, 2), | 436 gfx::Size(1, 2), |
| 437 true, | 437 true, |
| 438 false); | 438 false); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 TEST_F(LayerTreeHostCommonTest, TransformsForSingleRenderSurface) { | 545 TEST_F(LayerTreeHostCommonTest, TransformsForSingleRenderSurface) { |
| 546 scoped_refptr<Layer> root = Layer::Create(); | 546 scoped_refptr<Layer> root = Layer::Create(); |
| 547 scoped_refptr<Layer> parent = Layer::Create(); | 547 scoped_refptr<Layer> parent = Layer::Create(); |
| 548 scoped_refptr<Layer> child = Layer::Create(); | 548 scoped_refptr<Layer> child = Layer::Create(); |
| 549 scoped_refptr<LayerWithForcedDrawsContent> grand_child = | 549 scoped_refptr<LayerWithForcedDrawsContent> grand_child = |
| 550 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 550 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 551 root->AddChild(parent); | 551 root->AddChild(parent); |
| 552 parent->AddChild(child); | 552 parent->AddChild(child); |
| 553 child->AddChild(grand_child); | 553 child->AddChild(grand_child); |
| 554 | 554 |
| 555 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 555 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 556 host->SetRootLayer(root); | 556 host->SetRootLayer(root); |
| 557 | 557 |
| 558 // One-time setup of root layer | 558 // One-time setup of root layer |
| 559 gfx::Transform identity_matrix; | 559 gfx::Transform identity_matrix; |
| 560 SetLayerPropertiesForTesting(root.get(), | 560 SetLayerPropertiesForTesting(root.get(), |
| 561 identity_matrix, | 561 identity_matrix, |
| 562 gfx::Point3F(), | 562 gfx::Point3F(), |
| 563 gfx::PointF(), | 563 gfx::PointF(), |
| 564 gfx::Size(1, 2), | 564 gfx::Size(1, 2), |
| 565 true, | 565 true, |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 scoped_refptr<Layer> parent = Layer::Create(); | 642 scoped_refptr<Layer> parent = Layer::Create(); |
| 643 scoped_refptr<Layer> child = Layer::Create(); | 643 scoped_refptr<Layer> child = Layer::Create(); |
| 644 scoped_refptr<Layer> child_replica = Layer::Create(); | 644 scoped_refptr<Layer> child_replica = Layer::Create(); |
| 645 scoped_refptr<LayerWithForcedDrawsContent> grand_child = | 645 scoped_refptr<LayerWithForcedDrawsContent> grand_child = |
| 646 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 646 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 647 root->AddChild(parent); | 647 root->AddChild(parent); |
| 648 parent->AddChild(child); | 648 parent->AddChild(child); |
| 649 child->AddChild(grand_child); | 649 child->AddChild(grand_child); |
| 650 child->SetReplicaLayer(child_replica.get()); | 650 child->SetReplicaLayer(child_replica.get()); |
| 651 | 651 |
| 652 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 652 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 653 host->SetRootLayer(root); | 653 host->SetRootLayer(root); |
| 654 | 654 |
| 655 // One-time setup of root layer | 655 // One-time setup of root layer |
| 656 gfx::Transform identity_matrix; | 656 gfx::Transform identity_matrix; |
| 657 SetLayerPropertiesForTesting(root.get(), | 657 SetLayerPropertiesForTesting(root.get(), |
| 658 identity_matrix, | 658 identity_matrix, |
| 659 gfx::Point3F(), | 659 gfx::Point3F(), |
| 660 gfx::PointF(), | 660 gfx::PointF(), |
| 661 gfx::Size(1, 2), | 661 gfx::Size(1, 2), |
| 662 true, | 662 true, |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 parent->AddChild(child_of_root); | 763 parent->AddChild(child_of_root); |
| 764 render_surface1->AddChild(child_of_rs1); | 764 render_surface1->AddChild(child_of_rs1); |
| 765 render_surface1->AddChild(render_surface2); | 765 render_surface1->AddChild(render_surface2); |
| 766 render_surface2->AddChild(child_of_rs2); | 766 render_surface2->AddChild(child_of_rs2); |
| 767 child_of_root->AddChild(grand_child_of_root); | 767 child_of_root->AddChild(grand_child_of_root); |
| 768 child_of_rs1->AddChild(grand_child_of_rs1); | 768 child_of_rs1->AddChild(grand_child_of_rs1); |
| 769 child_of_rs2->AddChild(grand_child_of_rs2); | 769 child_of_rs2->AddChild(grand_child_of_rs2); |
| 770 render_surface1->SetReplicaLayer(replica_of_rs1.get()); | 770 render_surface1->SetReplicaLayer(replica_of_rs1.get()); |
| 771 render_surface2->SetReplicaLayer(replica_of_rs2.get()); | 771 render_surface2->SetReplicaLayer(replica_of_rs2.get()); |
| 772 | 772 |
| 773 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 773 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 774 host->SetRootLayer(root); | 774 host->SetRootLayer(root); |
| 775 | 775 |
| 776 // In combination with descendant draws content, opacity != 1 forces the layer | 776 // In combination with descendant draws content, opacity != 1 forces the layer |
| 777 // to have a new render surface. | 777 // to have a new render surface. |
| 778 render_surface1->SetOpacity(0.5f); | 778 render_surface1->SetOpacity(0.5f); |
| 779 render_surface2->SetOpacity(0.33f); | 779 render_surface2->SetOpacity(0.33f); |
| 780 | 780 |
| 781 // One-time setup of root layer | 781 // One-time setup of root layer |
| 782 gfx::Transform identity_matrix; | 782 gfx::Transform identity_matrix; |
| 783 SetLayerPropertiesForTesting(root.get(), | 783 SetLayerPropertiesForTesting(root.get(), |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 gfx::Point3F(), | 1058 gfx::Point3F(), |
| 1059 gfx::PointF(), | 1059 gfx::PointF(), |
| 1060 gfx::Size(10, 10), | 1060 gfx::Size(10, 10), |
| 1061 true, | 1061 true, |
| 1062 false); | 1062 false); |
| 1063 | 1063 |
| 1064 root->AddChild(child); | 1064 root->AddChild(child); |
| 1065 child->AddChild(grand_child); | 1065 child->AddChild(grand_child); |
| 1066 child->SetForceRenderSurface(true); | 1066 child->SetForceRenderSurface(true); |
| 1067 | 1067 |
| 1068 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1068 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1069 host->SetRootLayer(root); | 1069 host->SetRootLayer(root); |
| 1070 | 1070 |
| 1071 // No layers in this test should preserve 3d. | 1071 // No layers in this test should preserve 3d. |
| 1072 ASSERT_TRUE(root->should_flatten_transform()); | 1072 ASSERT_TRUE(root->should_flatten_transform()); |
| 1073 ASSERT_TRUE(child->should_flatten_transform()); | 1073 ASSERT_TRUE(child->should_flatten_transform()); |
| 1074 ASSERT_TRUE(grand_child->should_flatten_transform()); | 1074 ASSERT_TRUE(grand_child->should_flatten_transform()); |
| 1075 | 1075 |
| 1076 gfx::Transform expected_child_draw_transform = rotation_about_y_axis; | 1076 gfx::Transform expected_child_draw_transform = rotation_about_y_axis; |
| 1077 gfx::Transform expected_child_screen_space_transform = rotation_about_y_axis; | 1077 gfx::Transform expected_child_screen_space_transform = rotation_about_y_axis; |
| 1078 gfx::Transform expected_grand_child_draw_transform = | 1078 gfx::Transform expected_grand_child_draw_transform = |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 gfx::Point3F(), | 1137 gfx::Point3F(), |
| 1138 gfx::PointF(), | 1138 gfx::PointF(), |
| 1139 gfx::Size(10, 10), | 1139 gfx::Size(10, 10), |
| 1140 true, | 1140 true, |
| 1141 false); | 1141 false); |
| 1142 | 1142 |
| 1143 root->AddChild(child); | 1143 root->AddChild(child); |
| 1144 child->AddChild(grand_child); | 1144 child->AddChild(grand_child); |
| 1145 child->SetForceRenderSurface(true); | 1145 child->SetForceRenderSurface(true); |
| 1146 | 1146 |
| 1147 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1147 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1148 host->SetRootLayer(root); | 1148 host->SetRootLayer(root); |
| 1149 | 1149 |
| 1150 ExecuteCalculateDrawProperties(root.get()); | 1150 ExecuteCalculateDrawProperties(root.get()); |
| 1151 | 1151 |
| 1152 ASSERT_TRUE(child->render_surface()); | 1152 ASSERT_TRUE(child->render_surface()); |
| 1153 // This is the real test, the rest are sanity checks. | 1153 // This is the real test, the rest are sanity checks. |
| 1154 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, | 1154 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, |
| 1155 child->render_surface()->draw_transform()); | 1155 child->render_surface()->draw_transform()); |
| 1156 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, child->draw_transform()); | 1156 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, child->draw_transform()); |
| 1157 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, | 1157 EXPECT_TRANSFORMATION_MATRIX_EQ(identity_matrix, |
| 1158 grand_child->draw_transform()); | 1158 grand_child->draw_transform()); |
| 1159 } | 1159 } |
| 1160 | 1160 |
| 1161 TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { | 1161 TEST_F(LayerTreeHostCommonTest, TransformAboveRootLayer) { |
| 1162 // Transformations applied at the root of the tree should be forwarded | 1162 // Transformations applied at the root of the tree should be forwarded |
| 1163 // to child layers instead of applied to the root RenderSurface. | 1163 // to child layers instead of applied to the root RenderSurface. |
| 1164 const gfx::Transform identity_matrix; | 1164 const gfx::Transform identity_matrix; |
| 1165 scoped_refptr<LayerWithForcedDrawsContent> root = | 1165 scoped_refptr<LayerWithForcedDrawsContent> root = |
| 1166 new LayerWithForcedDrawsContent; | 1166 new LayerWithForcedDrawsContent; |
| 1167 scoped_refptr<LayerWithForcedDrawsContent> child = | 1167 scoped_refptr<LayerWithForcedDrawsContent> child = |
| 1168 new LayerWithForcedDrawsContent; | 1168 new LayerWithForcedDrawsContent; |
| 1169 child->SetScrollClipLayerId(root->id()); | 1169 child->SetScrollClipLayerId(root->id()); |
| 1170 root->AddChild(child); | 1170 root->AddChild(child); |
| 1171 | 1171 |
| 1172 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1172 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1173 host->SetRootLayer(root); | 1173 host->SetRootLayer(root); |
| 1174 | 1174 |
| 1175 SetLayerPropertiesForTesting(root.get(), | 1175 SetLayerPropertiesForTesting(root.get(), |
| 1176 identity_matrix, | 1176 identity_matrix, |
| 1177 gfx::Point3F(), | 1177 gfx::Point3F(), |
| 1178 gfx::PointF(), | 1178 gfx::PointF(), |
| 1179 gfx::Size(20, 20), | 1179 gfx::Size(20, 20), |
| 1180 true, | 1180 true, |
| 1181 false); | 1181 false); |
| 1182 SetLayerPropertiesForTesting(child.get(), | 1182 SetLayerPropertiesForTesting(child.get(), |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 } | 1308 } |
| 1309 } | 1309 } |
| 1310 | 1310 |
| 1311 TEST_F(LayerTreeHostCommonTest, | 1311 TEST_F(LayerTreeHostCommonTest, |
| 1312 RenderSurfaceListForRenderSurfaceWithClippedLayer) { | 1312 RenderSurfaceListForRenderSurfaceWithClippedLayer) { |
| 1313 scoped_refptr<Layer> parent = Layer::Create(); | 1313 scoped_refptr<Layer> parent = Layer::Create(); |
| 1314 scoped_refptr<Layer> render_surface1 = Layer::Create(); | 1314 scoped_refptr<Layer> render_surface1 = Layer::Create(); |
| 1315 scoped_refptr<LayerWithForcedDrawsContent> child = | 1315 scoped_refptr<LayerWithForcedDrawsContent> child = |
| 1316 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1316 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1317 | 1317 |
| 1318 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1318 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1319 host->SetRootLayer(parent); | 1319 host->SetRootLayer(parent); |
| 1320 | 1320 |
| 1321 const gfx::Transform identity_matrix; | 1321 const gfx::Transform identity_matrix; |
| 1322 SetLayerPropertiesForTesting(parent.get(), | 1322 SetLayerPropertiesForTesting(parent.get(), |
| 1323 identity_matrix, | 1323 identity_matrix, |
| 1324 gfx::Point3F(), | 1324 gfx::Point3F(), |
| 1325 gfx::PointF(), | 1325 gfx::PointF(), |
| 1326 gfx::Size(10, 10), | 1326 gfx::Size(10, 10), |
| 1327 true, | 1327 true, |
| 1328 false); | 1328 false); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1362 ASSERT_TRUE(parent->render_surface()); | 1362 ASSERT_TRUE(parent->render_surface()); |
| 1363 EXPECT_EQ(1U, render_surface_layer_list.size()); | 1363 EXPECT_EQ(1U, render_surface_layer_list.size()); |
| 1364 } | 1364 } |
| 1365 | 1365 |
| 1366 TEST_F(LayerTreeHostCommonTest, RenderSurfaceListForTransparentChild) { | 1366 TEST_F(LayerTreeHostCommonTest, RenderSurfaceListForTransparentChild) { |
| 1367 scoped_refptr<Layer> parent = Layer::Create(); | 1367 scoped_refptr<Layer> parent = Layer::Create(); |
| 1368 scoped_refptr<Layer> render_surface1 = Layer::Create(); | 1368 scoped_refptr<Layer> render_surface1 = Layer::Create(); |
| 1369 scoped_refptr<LayerWithForcedDrawsContent> child = | 1369 scoped_refptr<LayerWithForcedDrawsContent> child = |
| 1370 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1370 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1371 | 1371 |
| 1372 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1372 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1373 host->SetRootLayer(parent); | 1373 host->SetRootLayer(parent); |
| 1374 | 1374 |
| 1375 const gfx::Transform identity_matrix; | 1375 const gfx::Transform identity_matrix; |
| 1376 SetLayerPropertiesForTesting(render_surface1.get(), | 1376 SetLayerPropertiesForTesting(render_surface1.get(), |
| 1377 identity_matrix, | 1377 identity_matrix, |
| 1378 gfx::Point3F(), | 1378 gfx::Point3F(), |
| 1379 gfx::PointF(), | 1379 gfx::PointF(), |
| 1380 gfx::Size(10, 10), | 1380 gfx::Size(10, 10), |
| 1381 true, | 1381 true, |
| 1382 false); | 1382 false); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1409 EXPECT_EQ(gfx::Rect(), parent->drawable_content_rect()); | 1409 EXPECT_EQ(gfx::Rect(), parent->drawable_content_rect()); |
| 1410 } | 1410 } |
| 1411 | 1411 |
| 1412 TEST_F(LayerTreeHostCommonTest, ForceRenderSurface) { | 1412 TEST_F(LayerTreeHostCommonTest, ForceRenderSurface) { |
| 1413 scoped_refptr<Layer> parent = Layer::Create(); | 1413 scoped_refptr<Layer> parent = Layer::Create(); |
| 1414 scoped_refptr<Layer> render_surface1 = Layer::Create(); | 1414 scoped_refptr<Layer> render_surface1 = Layer::Create(); |
| 1415 scoped_refptr<LayerWithForcedDrawsContent> child = | 1415 scoped_refptr<LayerWithForcedDrawsContent> child = |
| 1416 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1416 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1417 render_surface1->SetForceRenderSurface(true); | 1417 render_surface1->SetForceRenderSurface(true); |
| 1418 | 1418 |
| 1419 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1419 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1420 host->SetRootLayer(parent); | 1420 host->SetRootLayer(parent); |
| 1421 | 1421 |
| 1422 const gfx::Transform identity_matrix; | 1422 const gfx::Transform identity_matrix; |
| 1423 SetLayerPropertiesForTesting(parent.get(), | 1423 SetLayerPropertiesForTesting(parent.get(), |
| 1424 identity_matrix, | 1424 identity_matrix, |
| 1425 gfx::Point3F(), | 1425 gfx::Point3F(), |
| 1426 gfx::PointF(), | 1426 gfx::PointF(), |
| 1427 gfx::Size(10, 10), | 1427 gfx::Size(10, 10), |
| 1428 true, | 1428 true, |
| 1429 false); | 1429 false); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1498 scoped_refptr<Layer> grand_child = Layer::Create(); | 1498 scoped_refptr<Layer> grand_child = Layer::Create(); |
| 1499 scoped_refptr<Layer> great_grand_child = Layer::Create(); | 1499 scoped_refptr<Layer> great_grand_child = Layer::Create(); |
| 1500 scoped_refptr<LayerWithForcedDrawsContent> leaf_node1 = | 1500 scoped_refptr<LayerWithForcedDrawsContent> leaf_node1 = |
| 1501 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1501 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1502 scoped_refptr<LayerWithForcedDrawsContent> leaf_node2 = | 1502 scoped_refptr<LayerWithForcedDrawsContent> leaf_node2 = |
| 1503 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1503 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1504 parent->AddChild(child); | 1504 parent->AddChild(child); |
| 1505 child->AddChild(grand_child); | 1505 child->AddChild(grand_child); |
| 1506 grand_child->AddChild(great_grand_child); | 1506 grand_child->AddChild(great_grand_child); |
| 1507 | 1507 |
| 1508 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1508 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1509 host->SetRootLayer(parent); | 1509 host->SetRootLayer(parent); |
| 1510 | 1510 |
| 1511 // leaf_node1 ensures that parent and child are kept on the | 1511 // leaf_node1 ensures that parent and child are kept on the |
| 1512 // render_surface_layer_list, even though grand_child and great_grand_child | 1512 // render_surface_layer_list, even though grand_child and great_grand_child |
| 1513 // should be clipped. | 1513 // should be clipped. |
| 1514 child->AddChild(leaf_node1); | 1514 child->AddChild(leaf_node1); |
| 1515 great_grand_child->AddChild(leaf_node2); | 1515 great_grand_child->AddChild(leaf_node2); |
| 1516 | 1516 |
| 1517 SetLayerPropertiesForTesting(parent.get(), | 1517 SetLayerPropertiesForTesting(parent.get(), |
| 1518 identity_matrix, | 1518 identity_matrix, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 const gfx::Transform identity_matrix; | 1596 const gfx::Transform identity_matrix; |
| 1597 scoped_refptr<Layer> parent = Layer::Create(); | 1597 scoped_refptr<Layer> parent = Layer::Create(); |
| 1598 scoped_refptr<Layer> child = Layer::Create(); | 1598 scoped_refptr<Layer> child = Layer::Create(); |
| 1599 scoped_refptr<Layer> grand_child = Layer::Create(); | 1599 scoped_refptr<Layer> grand_child = Layer::Create(); |
| 1600 scoped_refptr<LayerWithForcedDrawsContent> leaf_node = | 1600 scoped_refptr<LayerWithForcedDrawsContent> leaf_node = |
| 1601 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1601 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1602 parent->AddChild(child); | 1602 parent->AddChild(child); |
| 1603 child->AddChild(grand_child); | 1603 child->AddChild(grand_child); |
| 1604 grand_child->AddChild(leaf_node); | 1604 grand_child->AddChild(leaf_node); |
| 1605 | 1605 |
| 1606 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1606 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1607 host->SetRootLayer(parent); | 1607 host->SetRootLayer(parent); |
| 1608 | 1608 |
| 1609 SetLayerPropertiesForTesting(parent.get(), | 1609 SetLayerPropertiesForTesting(parent.get(), |
| 1610 identity_matrix, | 1610 identity_matrix, |
| 1611 gfx::Point3F(), | 1611 gfx::Point3F(), |
| 1612 gfx::PointF(), | 1612 gfx::PointF(), |
| 1613 gfx::Size(100, 100), | 1613 gfx::Size(100, 100), |
| 1614 true, | 1614 true, |
| 1615 false); | 1615 false); |
| 1616 SetLayerPropertiesForTesting(child.get(), | 1616 SetLayerPropertiesForTesting(child.get(), |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1698 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1699 scoped_refptr<LayerWithForcedDrawsContent> leaf_node2 = | 1699 scoped_refptr<LayerWithForcedDrawsContent> leaf_node2 = |
| 1700 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1700 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1701 root->AddChild(parent); | 1701 root->AddChild(parent); |
| 1702 parent->AddChild(child1); | 1702 parent->AddChild(child1); |
| 1703 parent->AddChild(child2); | 1703 parent->AddChild(child2); |
| 1704 child1->AddChild(grand_child); | 1704 child1->AddChild(grand_child); |
| 1705 child2->AddChild(leaf_node2); | 1705 child2->AddChild(leaf_node2); |
| 1706 grand_child->AddChild(leaf_node1); | 1706 grand_child->AddChild(leaf_node1); |
| 1707 | 1707 |
| 1708 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1708 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1709 host->SetRootLayer(root); | 1709 host->SetRootLayer(root); |
| 1710 | 1710 |
| 1711 child2->SetForceRenderSurface(true); | 1711 child2->SetForceRenderSurface(true); |
| 1712 | 1712 |
| 1713 SetLayerPropertiesForTesting(root.get(), | 1713 SetLayerPropertiesForTesting(root.get(), |
| 1714 identity_matrix, | 1714 identity_matrix, |
| 1715 gfx::Point3F(), | 1715 gfx::Point3F(), |
| 1716 gfx::PointF(), | 1716 gfx::PointF(), |
| 1717 gfx::Size(100, 100), | 1717 gfx::Size(100, 100), |
| 1718 true, | 1718 true, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1856 scoped_refptr<Layer> grand_child2 = Layer::Create(); | 1856 scoped_refptr<Layer> grand_child2 = Layer::Create(); |
| 1857 scoped_refptr<Layer> grand_child3 = Layer::Create(); | 1857 scoped_refptr<Layer> grand_child3 = Layer::Create(); |
| 1858 scoped_refptr<Layer> grand_child4 = Layer::Create(); | 1858 scoped_refptr<Layer> grand_child4 = Layer::Create(); |
| 1859 | 1859 |
| 1860 parent->AddChild(child); | 1860 parent->AddChild(child); |
| 1861 child->AddChild(grand_child1); | 1861 child->AddChild(grand_child1); |
| 1862 child->AddChild(grand_child2); | 1862 child->AddChild(grand_child2); |
| 1863 child->AddChild(grand_child3); | 1863 child->AddChild(grand_child3); |
| 1864 child->AddChild(grand_child4); | 1864 child->AddChild(grand_child4); |
| 1865 | 1865 |
| 1866 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1866 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1867 host->SetRootLayer(parent); | 1867 host->SetRootLayer(parent); |
| 1868 | 1868 |
| 1869 SetLayerPropertiesForTesting(parent.get(), | 1869 SetLayerPropertiesForTesting(parent.get(), |
| 1870 identity_matrix, | 1870 identity_matrix, |
| 1871 gfx::Point3F(), | 1871 gfx::Point3F(), |
| 1872 gfx::PointF(), | 1872 gfx::PointF(), |
| 1873 gfx::Size(500, 500), | 1873 gfx::Size(500, 500), |
| 1874 true, | 1874 true, |
| 1875 false); | 1875 false); |
| 1876 SetLayerPropertiesForTesting(child.get(), | 1876 SetLayerPropertiesForTesting(child.get(), |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1957 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1958 scoped_refptr<LayerWithForcedDrawsContent> leaf_node4 = | 1958 scoped_refptr<LayerWithForcedDrawsContent> leaf_node4 = |
| 1959 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 1959 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 1960 | 1960 |
| 1961 parent->AddChild(child); | 1961 parent->AddChild(child); |
| 1962 child->AddChild(grand_child1); | 1962 child->AddChild(grand_child1); |
| 1963 child->AddChild(grand_child2); | 1963 child->AddChild(grand_child2); |
| 1964 child->AddChild(grand_child3); | 1964 child->AddChild(grand_child3); |
| 1965 child->AddChild(grand_child4); | 1965 child->AddChild(grand_child4); |
| 1966 | 1966 |
| 1967 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 1967 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 1968 host->SetRootLayer(parent); | 1968 host->SetRootLayer(parent); |
| 1969 | 1969 |
| 1970 // the leaf nodes ensure that these grand_children become render surfaces for | 1970 // the leaf nodes ensure that these grand_children become render surfaces for |
| 1971 // this test. | 1971 // this test. |
| 1972 grand_child1->AddChild(leaf_node1); | 1972 grand_child1->AddChild(leaf_node1); |
| 1973 grand_child2->AddChild(leaf_node2); | 1973 grand_child2->AddChild(leaf_node2); |
| 1974 grand_child3->AddChild(leaf_node3); | 1974 grand_child3->AddChild(leaf_node3); |
| 1975 grand_child4->AddChild(leaf_node4); | 1975 grand_child4->AddChild(leaf_node4); |
| 1976 | 1976 |
| 1977 SetLayerPropertiesForTesting(parent.get(), | 1977 SetLayerPropertiesForTesting(parent.get(), |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2094 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2094 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2095 parent->AddChild(render_surface1); | 2095 parent->AddChild(render_surface1); |
| 2096 parent->AddChild(child_of_root); | 2096 parent->AddChild(child_of_root); |
| 2097 render_surface1->AddChild(child_of_rs1); | 2097 render_surface1->AddChild(child_of_rs1); |
| 2098 render_surface1->AddChild(render_surface2); | 2098 render_surface1->AddChild(render_surface2); |
| 2099 render_surface2->AddChild(child_of_rs2); | 2099 render_surface2->AddChild(child_of_rs2); |
| 2100 child_of_root->AddChild(grand_child_of_root); | 2100 child_of_root->AddChild(grand_child_of_root); |
| 2101 child_of_rs1->AddChild(grand_child_of_rs1); | 2101 child_of_rs1->AddChild(grand_child_of_rs1); |
| 2102 child_of_rs2->AddChild(grand_child_of_rs2); | 2102 child_of_rs2->AddChild(grand_child_of_rs2); |
| 2103 | 2103 |
| 2104 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2104 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2105 host->SetRootLayer(parent); | 2105 host->SetRootLayer(parent); |
| 2106 | 2106 |
| 2107 // Make our render surfaces. | 2107 // Make our render surfaces. |
| 2108 render_surface1->SetForceRenderSurface(true); | 2108 render_surface1->SetForceRenderSurface(true); |
| 2109 render_surface2->SetForceRenderSurface(true); | 2109 render_surface2->SetForceRenderSurface(true); |
| 2110 | 2110 |
| 2111 gfx::Transform layer_transform; | 2111 gfx::Transform layer_transform; |
| 2112 layer_transform.Translate(1.0, 1.0); | 2112 layer_transform.Translate(1.0, 1.0); |
| 2113 | 2113 |
| 2114 SetLayerPropertiesForTesting(parent.get(), | 2114 SetLayerPropertiesForTesting(parent.get(), |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2582 scoped_refptr<LayerWithForcedDrawsContent> child1 = | 2582 scoped_refptr<LayerWithForcedDrawsContent> child1 = |
| 2583 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2583 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2584 scoped_refptr<LayerWithForcedDrawsContent> child2 = | 2584 scoped_refptr<LayerWithForcedDrawsContent> child2 = |
| 2585 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2585 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2586 scoped_refptr<LayerWithForcedDrawsContent> child3 = | 2586 scoped_refptr<LayerWithForcedDrawsContent> child3 = |
| 2587 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2587 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2588 root->AddChild(child1); | 2588 root->AddChild(child1); |
| 2589 root->AddChild(child2); | 2589 root->AddChild(child2); |
| 2590 root->AddChild(child3); | 2590 root->AddChild(child3); |
| 2591 | 2591 |
| 2592 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2592 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2593 host->SetRootLayer(root); | 2593 host->SetRootLayer(root); |
| 2594 | 2594 |
| 2595 gfx::Transform identity_matrix; | 2595 gfx::Transform identity_matrix; |
| 2596 SetLayerPropertiesForTesting(root.get(), | 2596 SetLayerPropertiesForTesting(root.get(), |
| 2597 identity_matrix, | 2597 identity_matrix, |
| 2598 gfx::Point3F(), | 2598 gfx::Point3F(), |
| 2599 gfx::PointF(), | 2599 gfx::PointF(), |
| 2600 gfx::Size(100, 100), | 2600 gfx::Size(100, 100), |
| 2601 true, | 2601 true, |
| 2602 false); | 2602 false); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2650 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2650 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2651 scoped_refptr<LayerWithForcedDrawsContent> grand_child2 = | 2651 scoped_refptr<LayerWithForcedDrawsContent> grand_child2 = |
| 2652 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2652 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2653 scoped_refptr<LayerWithForcedDrawsContent> grand_child3 = | 2653 scoped_refptr<LayerWithForcedDrawsContent> grand_child3 = |
| 2654 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2654 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2655 root->AddChild(child); | 2655 root->AddChild(child); |
| 2656 child->AddChild(grand_child1); | 2656 child->AddChild(grand_child1); |
| 2657 child->AddChild(grand_child2); | 2657 child->AddChild(grand_child2); |
| 2658 child->AddChild(grand_child3); | 2658 child->AddChild(grand_child3); |
| 2659 | 2659 |
| 2660 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2660 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2661 host->SetRootLayer(root); | 2661 host->SetRootLayer(root); |
| 2662 | 2662 |
| 2663 gfx::Transform identity_matrix; | 2663 gfx::Transform identity_matrix; |
| 2664 SetLayerPropertiesForTesting(root.get(), | 2664 SetLayerPropertiesForTesting(root.get(), |
| 2665 identity_matrix, | 2665 identity_matrix, |
| 2666 gfx::Point3F(), | 2666 gfx::Point3F(), |
| 2667 gfx::PointF(), | 2667 gfx::PointF(), |
| 2668 gfx::Size(100, 100), | 2668 gfx::Size(100, 100), |
| 2669 true, | 2669 true, |
| 2670 false); | 2670 false); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2731 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2731 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2732 scoped_refptr<LayerWithForcedDrawsContent> child2 = | 2732 scoped_refptr<LayerWithForcedDrawsContent> child2 = |
| 2733 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2733 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2734 scoped_refptr<LayerWithForcedDrawsContent> child3 = | 2734 scoped_refptr<LayerWithForcedDrawsContent> child3 = |
| 2735 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2735 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2736 root->AddChild(render_surface1); | 2736 root->AddChild(render_surface1); |
| 2737 render_surface1->AddChild(child1); | 2737 render_surface1->AddChild(child1); |
| 2738 render_surface1->AddChild(child2); | 2738 render_surface1->AddChild(child2); |
| 2739 render_surface1->AddChild(child3); | 2739 render_surface1->AddChild(child3); |
| 2740 | 2740 |
| 2741 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2741 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2742 host->SetRootLayer(root); | 2742 host->SetRootLayer(root); |
| 2743 | 2743 |
| 2744 gfx::Transform identity_matrix; | 2744 gfx::Transform identity_matrix; |
| 2745 SetLayerPropertiesForTesting(root.get(), | 2745 SetLayerPropertiesForTesting(root.get(), |
| 2746 identity_matrix, | 2746 identity_matrix, |
| 2747 gfx::Point3F(), | 2747 gfx::Point3F(), |
| 2748 gfx::PointF(), | 2748 gfx::PointF(), |
| 2749 gfx::Size(100, 100), | 2749 gfx::Size(100, 100), |
| 2750 true, | 2750 true, |
| 2751 false); | 2751 false); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2807 EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); | 2807 EXPECT_RECT_EQ(gfx::Rect(125, 125, 50, 50), child3->drawable_content_rect()); |
| 2808 } | 2808 } |
| 2809 | 2809 |
| 2810 TEST_F(LayerTreeHostCommonTest, | 2810 TEST_F(LayerTreeHostCommonTest, |
| 2811 DrawableAndVisibleContentRectsForLayersWithUninvertibleTransform) { | 2811 DrawableAndVisibleContentRectsForLayersWithUninvertibleTransform) { |
| 2812 scoped_refptr<Layer> root = Layer::Create(); | 2812 scoped_refptr<Layer> root = Layer::Create(); |
| 2813 scoped_refptr<LayerWithForcedDrawsContent> child = | 2813 scoped_refptr<LayerWithForcedDrawsContent> child = |
| 2814 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2814 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2815 root->AddChild(child); | 2815 root->AddChild(child); |
| 2816 | 2816 |
| 2817 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2817 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2818 host->SetRootLayer(root); | 2818 host->SetRootLayer(root); |
| 2819 | 2819 |
| 2820 // Case 1: a truly degenerate matrix | 2820 // Case 1: a truly degenerate matrix |
| 2821 gfx::Transform identity_matrix; | 2821 gfx::Transform identity_matrix; |
| 2822 gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); | 2822 gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); |
| 2823 ASSERT_FALSE(uninvertible_matrix.IsInvertible()); | 2823 ASSERT_FALSE(uninvertible_matrix.IsInvertible()); |
| 2824 | 2824 |
| 2825 SetLayerPropertiesForTesting(root.get(), | 2825 SetLayerPropertiesForTesting(root.get(), |
| 2826 identity_matrix, | 2826 identity_matrix, |
| 2827 gfx::Point3F(), | 2827 gfx::Point3F(), |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2881 EXPECT_TRUE(child->drawable_content_rect().IsEmpty()); | 2881 EXPECT_TRUE(child->drawable_content_rect().IsEmpty()); |
| 2882 } | 2882 } |
| 2883 | 2883 |
| 2884 TEST_F(LayerTreeHostCommonTest, | 2884 TEST_F(LayerTreeHostCommonTest, |
| 2885 SingularTransformDoesNotPreventClearingDrawProperties) { | 2885 SingularTransformDoesNotPreventClearingDrawProperties) { |
| 2886 scoped_refptr<Layer> root = Layer::Create(); | 2886 scoped_refptr<Layer> root = Layer::Create(); |
| 2887 scoped_refptr<LayerWithForcedDrawsContent> child = | 2887 scoped_refptr<LayerWithForcedDrawsContent> child = |
| 2888 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2888 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2889 root->AddChild(child); | 2889 root->AddChild(child); |
| 2890 | 2890 |
| 2891 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2891 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2892 host->SetRootLayer(root); | 2892 host->SetRootLayer(root); |
| 2893 | 2893 |
| 2894 gfx::Transform identity_matrix; | 2894 gfx::Transform identity_matrix; |
| 2895 gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); | 2895 gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); |
| 2896 ASSERT_FALSE(uninvertible_matrix.IsInvertible()); | 2896 ASSERT_FALSE(uninvertible_matrix.IsInvertible()); |
| 2897 | 2897 |
| 2898 SetLayerPropertiesForTesting(root.get(), | 2898 SetLayerPropertiesForTesting(root.get(), |
| 2899 uninvertible_matrix, | 2899 uninvertible_matrix, |
| 2900 gfx::Point3F(), | 2900 gfx::Point3F(), |
| 2901 gfx::PointF(), | 2901 gfx::PointF(), |
| (...skipping 23 matching lines...) Expand all Loading... |
| 2925 | 2925 |
| 2926 ExecuteCalculateDrawProperties(root.get()); | 2926 ExecuteCalculateDrawProperties(root.get()); |
| 2927 | 2927 |
| 2928 EXPECT_FALSE(child->draw_properties().sorted_for_recursion); | 2928 EXPECT_FALSE(child->draw_properties().sorted_for_recursion); |
| 2929 } | 2929 } |
| 2930 | 2930 |
| 2931 TEST_F(LayerTreeHostCommonTest, | 2931 TEST_F(LayerTreeHostCommonTest, |
| 2932 SingularNonAnimatingTransformDoesNotPreventClearingDrawProperties) { | 2932 SingularNonAnimatingTransformDoesNotPreventClearingDrawProperties) { |
| 2933 scoped_refptr<Layer> root = Layer::Create(); | 2933 scoped_refptr<Layer> root = Layer::Create(); |
| 2934 | 2934 |
| 2935 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2935 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2936 host->SetRootLayer(root); | 2936 host->SetRootLayer(root); |
| 2937 | 2937 |
| 2938 gfx::Transform identity_matrix; | 2938 gfx::Transform identity_matrix; |
| 2939 gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); | 2939 gfx::Transform uninvertible_matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); |
| 2940 ASSERT_FALSE(uninvertible_matrix.IsInvertible()); | 2940 ASSERT_FALSE(uninvertible_matrix.IsInvertible()); |
| 2941 | 2941 |
| 2942 SetLayerPropertiesForTesting(root.get(), | 2942 SetLayerPropertiesForTesting(root.get(), |
| 2943 uninvertible_matrix, | 2943 uninvertible_matrix, |
| 2944 gfx::Point3F(), | 2944 gfx::Point3F(), |
| 2945 gfx::PointF(), | 2945 gfx::PointF(), |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2964 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2964 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2965 scoped_refptr<LayerWithForcedDrawsContent> child2 = | 2965 scoped_refptr<LayerWithForcedDrawsContent> child2 = |
| 2966 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2966 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2967 scoped_refptr<LayerWithForcedDrawsContent> child3 = | 2967 scoped_refptr<LayerWithForcedDrawsContent> child3 = |
| 2968 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 2968 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 2969 root->AddChild(render_surface1); | 2969 root->AddChild(render_surface1); |
| 2970 render_surface1->AddChild(child1); | 2970 render_surface1->AddChild(child1); |
| 2971 render_surface1->AddChild(child2); | 2971 render_surface1->AddChild(child2); |
| 2972 render_surface1->AddChild(child3); | 2972 render_surface1->AddChild(child3); |
| 2973 | 2973 |
| 2974 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 2974 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 2975 host->SetRootLayer(root); | 2975 host->SetRootLayer(root); |
| 2976 | 2976 |
| 2977 gfx::Transform identity_matrix; | 2977 gfx::Transform identity_matrix; |
| 2978 SetLayerPropertiesForTesting(root.get(), | 2978 SetLayerPropertiesForTesting(root.get(), |
| 2979 identity_matrix, | 2979 identity_matrix, |
| 2980 gfx::Point3F(), | 2980 gfx::Point3F(), |
| 2981 gfx::PointF(), | 2981 gfx::PointF(), |
| 2982 gfx::Size(100, 100), | 2982 gfx::Size(100, 100), |
| 2983 true, | 2983 true, |
| 2984 false); | 2984 false); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3054 scoped_refptr<LayerWithForcedDrawsContent> child2 = | 3054 scoped_refptr<LayerWithForcedDrawsContent> child2 = |
| 3055 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3055 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3056 scoped_refptr<LayerWithForcedDrawsContent> child3 = | 3056 scoped_refptr<LayerWithForcedDrawsContent> child3 = |
| 3057 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3057 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3058 root->AddChild(render_surface1); | 3058 root->AddChild(render_surface1); |
| 3059 render_surface1->AddChild(render_surface2); | 3059 render_surface1->AddChild(render_surface2); |
| 3060 render_surface2->AddChild(child1); | 3060 render_surface2->AddChild(child1); |
| 3061 render_surface2->AddChild(child2); | 3061 render_surface2->AddChild(child2); |
| 3062 render_surface2->AddChild(child3); | 3062 render_surface2->AddChild(child3); |
| 3063 | 3063 |
| 3064 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3064 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3065 host->SetRootLayer(root); | 3065 host->SetRootLayer(root); |
| 3066 | 3066 |
| 3067 gfx::Transform identity_matrix; | 3067 gfx::Transform identity_matrix; |
| 3068 SetLayerPropertiesForTesting(root.get(), | 3068 SetLayerPropertiesForTesting(root.get(), |
| 3069 identity_matrix, | 3069 identity_matrix, |
| 3070 gfx::Point3F(), | 3070 gfx::Point3F(), |
| 3071 gfx::PointF(), | 3071 gfx::PointF(), |
| 3072 gfx::Size(100, 100), | 3072 gfx::Size(100, 100), |
| 3073 true, | 3073 true, |
| 3074 false); | 3074 false); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3154 // Layers that have non-axis aligned bounds (due to transforms) have an | 3154 // Layers that have non-axis aligned bounds (due to transforms) have an |
| 3155 // expanded, axis-aligned DrawableContentRect and visible content rect. | 3155 // expanded, axis-aligned DrawableContentRect and visible content rect. |
| 3156 | 3156 |
| 3157 scoped_refptr<Layer> root = Layer::Create(); | 3157 scoped_refptr<Layer> root = Layer::Create(); |
| 3158 scoped_refptr<Layer> render_surface1 = Layer::Create(); | 3158 scoped_refptr<Layer> render_surface1 = Layer::Create(); |
| 3159 scoped_refptr<LayerWithForcedDrawsContent> child1 = | 3159 scoped_refptr<LayerWithForcedDrawsContent> child1 = |
| 3160 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3160 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3161 root->AddChild(render_surface1); | 3161 root->AddChild(render_surface1); |
| 3162 render_surface1->AddChild(child1); | 3162 render_surface1->AddChild(child1); |
| 3163 | 3163 |
| 3164 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3164 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3165 host->SetRootLayer(root); | 3165 host->SetRootLayer(root); |
| 3166 | 3166 |
| 3167 gfx::Transform identity_matrix; | 3167 gfx::Transform identity_matrix; |
| 3168 gfx::Transform child_rotation; | 3168 gfx::Transform child_rotation; |
| 3169 child_rotation.Rotate(45.0); | 3169 child_rotation.Rotate(45.0); |
| 3170 SetLayerPropertiesForTesting(root.get(), | 3170 SetLayerPropertiesForTesting(root.get(), |
| 3171 identity_matrix, | 3171 identity_matrix, |
| 3172 gfx::Point3F(), | 3172 gfx::Point3F(), |
| 3173 gfx::PointF(), | 3173 gfx::PointF(), |
| 3174 gfx::Size(100, 100), | 3174 gfx::Size(100, 100), |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3225 // Layers that have non-axis aligned bounds (due to transforms) have an | 3225 // Layers that have non-axis aligned bounds (due to transforms) have an |
| 3226 // expanded, axis-aligned DrawableContentRect and visible content rect. | 3226 // expanded, axis-aligned DrawableContentRect and visible content rect. |
| 3227 | 3227 |
| 3228 scoped_refptr<Layer> root = Layer::Create(); | 3228 scoped_refptr<Layer> root = Layer::Create(); |
| 3229 scoped_refptr<Layer> render_surface1 = Layer::Create(); | 3229 scoped_refptr<Layer> render_surface1 = Layer::Create(); |
| 3230 scoped_refptr<LayerWithForcedDrawsContent> child1 = | 3230 scoped_refptr<LayerWithForcedDrawsContent> child1 = |
| 3231 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3231 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3232 root->AddChild(render_surface1); | 3232 root->AddChild(render_surface1); |
| 3233 render_surface1->AddChild(child1); | 3233 render_surface1->AddChild(child1); |
| 3234 | 3234 |
| 3235 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3235 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3236 host->SetRootLayer(root); | 3236 host->SetRootLayer(root); |
| 3237 | 3237 |
| 3238 gfx::Transform identity_matrix; | 3238 gfx::Transform identity_matrix; |
| 3239 gfx::Transform child_rotation; | 3239 gfx::Transform child_rotation; |
| 3240 child_rotation.Rotate(45.0); | 3240 child_rotation.Rotate(45.0); |
| 3241 SetLayerPropertiesForTesting(root.get(), | 3241 SetLayerPropertiesForTesting(root.get(), |
| 3242 identity_matrix, | 3242 identity_matrix, |
| 3243 gfx::Point3F(), | 3243 gfx::Point3F(), |
| 3244 gfx::PointF(), | 3244 gfx::PointF(), |
| 3245 gfx::Size(50, 50), | 3245 gfx::Size(50, 50), |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3300 CreateDrawableContentLayer(&client); | 3300 CreateDrawableContentLayer(&client); |
| 3301 scoped_refptr<ContentLayer> child1 = CreateDrawableContentLayer(&client); | 3301 scoped_refptr<ContentLayer> child1 = CreateDrawableContentLayer(&client); |
| 3302 scoped_refptr<ContentLayer> child2 = CreateDrawableContentLayer(&client); | 3302 scoped_refptr<ContentLayer> child2 = CreateDrawableContentLayer(&client); |
| 3303 scoped_refptr<ContentLayer> child3 = CreateDrawableContentLayer(&client); | 3303 scoped_refptr<ContentLayer> child3 = CreateDrawableContentLayer(&client); |
| 3304 root->AddChild(render_surface1); | 3304 root->AddChild(render_surface1); |
| 3305 render_surface1->AddChild(render_surface2); | 3305 render_surface1->AddChild(render_surface2); |
| 3306 render_surface2->AddChild(child1); | 3306 render_surface2->AddChild(child1); |
| 3307 render_surface2->AddChild(child2); | 3307 render_surface2->AddChild(child2); |
| 3308 render_surface2->AddChild(child3); | 3308 render_surface2->AddChild(child3); |
| 3309 | 3309 |
| 3310 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3310 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3311 host->SetRootLayer(root); | 3311 host->SetRootLayer(root); |
| 3312 | 3312 |
| 3313 gfx::Transform identity_matrix; | 3313 gfx::Transform identity_matrix; |
| 3314 SetLayerPropertiesForTesting(root.get(), | 3314 SetLayerPropertiesForTesting(root.get(), |
| 3315 identity_matrix, | 3315 identity_matrix, |
| 3316 gfx::Point3F(), | 3316 gfx::Point3F(), |
| 3317 gfx::PointF(), | 3317 gfx::PointF(), |
| 3318 gfx::Size(100, 100), | 3318 gfx::Size(100, 100), |
| 3319 true, | 3319 true, |
| 3320 false); | 3320 false); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3427 | 3427 |
| 3428 parent->AddChild(front_facing_child); | 3428 parent->AddChild(front_facing_child); |
| 3429 parent->AddChild(back_facing_child); | 3429 parent->AddChild(back_facing_child); |
| 3430 parent->AddChild(front_facing_surface); | 3430 parent->AddChild(front_facing_surface); |
| 3431 parent->AddChild(back_facing_surface); | 3431 parent->AddChild(back_facing_surface); |
| 3432 front_facing_surface->AddChild(front_facing_child_of_front_facing_surface); | 3432 front_facing_surface->AddChild(front_facing_child_of_front_facing_surface); |
| 3433 front_facing_surface->AddChild(back_facing_child_of_front_facing_surface); | 3433 front_facing_surface->AddChild(back_facing_child_of_front_facing_surface); |
| 3434 back_facing_surface->AddChild(front_facing_child_of_back_facing_surface); | 3434 back_facing_surface->AddChild(front_facing_child_of_back_facing_surface); |
| 3435 back_facing_surface->AddChild(back_facing_child_of_back_facing_surface); | 3435 back_facing_surface->AddChild(back_facing_child_of_back_facing_surface); |
| 3436 | 3436 |
| 3437 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3437 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3438 host->SetRootLayer(parent); | 3438 host->SetRootLayer(parent); |
| 3439 | 3439 |
| 3440 // Nothing is double-sided | 3440 // Nothing is double-sided |
| 3441 front_facing_child->SetDoubleSided(false); | 3441 front_facing_child->SetDoubleSided(false); |
| 3442 back_facing_child->SetDoubleSided(false); | 3442 back_facing_child->SetDoubleSided(false); |
| 3443 front_facing_surface->SetDoubleSided(false); | 3443 front_facing_surface->SetDoubleSided(false); |
| 3444 back_facing_surface->SetDoubleSided(false); | 3444 back_facing_surface->SetDoubleSided(false); |
| 3445 front_facing_child_of_front_facing_surface->SetDoubleSided(false); | 3445 front_facing_child_of_front_facing_surface->SetDoubleSided(false); |
| 3446 back_facing_child_of_front_facing_surface->SetDoubleSided(false); | 3446 back_facing_child_of_front_facing_surface->SetDoubleSided(false); |
| 3447 front_facing_child_of_back_facing_surface->SetDoubleSided(false); | 3447 front_facing_child_of_back_facing_surface->SetDoubleSided(false); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3633 | 3633 |
| 3634 parent->AddChild(front_facing_child); | 3634 parent->AddChild(front_facing_child); |
| 3635 parent->AddChild(back_facing_child); | 3635 parent->AddChild(back_facing_child); |
| 3636 parent->AddChild(front_facing_surface); | 3636 parent->AddChild(front_facing_surface); |
| 3637 parent->AddChild(back_facing_surface); | 3637 parent->AddChild(back_facing_surface); |
| 3638 front_facing_surface->AddChild(front_facing_child_of_front_facing_surface); | 3638 front_facing_surface->AddChild(front_facing_child_of_front_facing_surface); |
| 3639 front_facing_surface->AddChild(back_facing_child_of_front_facing_surface); | 3639 front_facing_surface->AddChild(back_facing_child_of_front_facing_surface); |
| 3640 back_facing_surface->AddChild(front_facing_child_of_back_facing_surface); | 3640 back_facing_surface->AddChild(front_facing_child_of_back_facing_surface); |
| 3641 back_facing_surface->AddChild(back_facing_child_of_back_facing_surface); | 3641 back_facing_surface->AddChild(back_facing_child_of_back_facing_surface); |
| 3642 | 3642 |
| 3643 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3643 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3644 host->SetRootLayer(parent); | 3644 host->SetRootLayer(parent); |
| 3645 | 3645 |
| 3646 // Nothing is double-sided | 3646 // Nothing is double-sided |
| 3647 front_facing_child->SetDoubleSided(false); | 3647 front_facing_child->SetDoubleSided(false); |
| 3648 back_facing_child->SetDoubleSided(false); | 3648 back_facing_child->SetDoubleSided(false); |
| 3649 front_facing_surface->SetDoubleSided(false); | 3649 front_facing_surface->SetDoubleSided(false); |
| 3650 back_facing_surface->SetDoubleSided(false); | 3650 back_facing_surface->SetDoubleSided(false); |
| 3651 front_facing_child_of_front_facing_surface->SetDoubleSided(false); | 3651 front_facing_child_of_front_facing_surface->SetDoubleSided(false); |
| 3652 back_facing_child_of_front_facing_surface->SetDoubleSided(false); | 3652 back_facing_child_of_front_facing_surface->SetDoubleSided(false); |
| 3653 front_facing_child_of_back_facing_surface->SetDoubleSided(false); | 3653 front_facing_child_of_back_facing_surface->SetDoubleSided(false); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3799 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3799 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3800 scoped_refptr<LayerWithForcedDrawsContent> child2 = | 3800 scoped_refptr<LayerWithForcedDrawsContent> child2 = |
| 3801 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3801 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3802 | 3802 |
| 3803 parent->AddChild(child); | 3803 parent->AddChild(child); |
| 3804 parent->AddChild(animating_surface); | 3804 parent->AddChild(animating_surface); |
| 3805 animating_surface->AddChild(child_of_animating_surface); | 3805 animating_surface->AddChild(child_of_animating_surface); |
| 3806 parent->AddChild(animating_child); | 3806 parent->AddChild(animating_child); |
| 3807 parent->AddChild(child2); | 3807 parent->AddChild(child2); |
| 3808 | 3808 |
| 3809 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3809 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3810 host->SetRootLayer(parent); | 3810 host->SetRootLayer(parent); |
| 3811 | 3811 |
| 3812 // Nothing is double-sided | 3812 // Nothing is double-sided |
| 3813 child->SetDoubleSided(false); | 3813 child->SetDoubleSided(false); |
| 3814 child2->SetDoubleSided(false); | 3814 child2->SetDoubleSided(false); |
| 3815 animating_surface->SetDoubleSided(false); | 3815 animating_surface->SetDoubleSided(false); |
| 3816 child_of_animating_surface->SetDoubleSided(false); | 3816 child_of_animating_surface->SetDoubleSided(false); |
| 3817 animating_child->SetDoubleSided(false); | 3817 animating_child->SetDoubleSided(false); |
| 3818 | 3818 |
| 3819 gfx::Transform backface_matrix; | 3819 gfx::Transform backface_matrix; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3945 scoped_refptr<LayerWithForcedDrawsContent> child1 = | 3945 scoped_refptr<LayerWithForcedDrawsContent> child1 = |
| 3946 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3946 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3947 scoped_refptr<LayerWithForcedDrawsContent> child2 = | 3947 scoped_refptr<LayerWithForcedDrawsContent> child2 = |
| 3948 make_scoped_refptr(new LayerWithForcedDrawsContent()); | 3948 make_scoped_refptr(new LayerWithForcedDrawsContent()); |
| 3949 | 3949 |
| 3950 parent->AddChild(front_facing_surface); | 3950 parent->AddChild(front_facing_surface); |
| 3951 parent->AddChild(back_facing_surface); | 3951 parent->AddChild(back_facing_surface); |
| 3952 front_facing_surface->AddChild(child1); | 3952 front_facing_surface->AddChild(child1); |
| 3953 back_facing_surface->AddChild(child2); | 3953 back_facing_surface->AddChild(child2); |
| 3954 | 3954 |
| 3955 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 3955 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 3956 host->SetRootLayer(parent); | 3956 host->SetRootLayer(parent); |
| 3957 | 3957 |
| 3958 // RenderSurfaces are not double-sided | 3958 // RenderSurfaces are not double-sided |
| 3959 front_facing_surface->SetDoubleSided(false); | 3959 front_facing_surface->SetDoubleSided(false); |
| 3960 back_facing_surface->SetDoubleSided(false); | 3960 back_facing_surface->SetDoubleSided(false); |
| 3961 | 3961 |
| 3962 gfx::Transform backface_matrix; | 3962 gfx::Transform backface_matrix; |
| 3963 backface_matrix.Translate(50.0, 50.0); | 3963 backface_matrix.Translate(50.0, 50.0); |
| 3964 backface_matrix.RotateAboutYAxis(180.0); | 3964 backface_matrix.RotateAboutYAxis(180.0); |
| 3965 backface_matrix.Translate(-50.0, -50.0); | 3965 backface_matrix.Translate(-50.0, -50.0); |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4121 gfx::Point3F(), | 4121 gfx::Point3F(), |
| 4122 gfx::PointF(2.f, 2.f), | 4122 gfx::PointF(2.f, 2.f), |
| 4123 gfx::Size(10, 10), | 4123 gfx::Size(10, 10), |
| 4124 false, | 4124 false, |
| 4125 true); | 4125 true); |
| 4126 | 4126 |
| 4127 parent->AddChild(child); | 4127 parent->AddChild(child); |
| 4128 parent->AddChild(child_empty); | 4128 parent->AddChild(child_empty); |
| 4129 parent->AddChild(child_no_scale); | 4129 parent->AddChild(child_no_scale); |
| 4130 | 4130 |
| 4131 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4131 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 4132 host->SetRootLayer(parent); | 4132 host->SetRootLayer(parent); |
| 4133 | 4133 |
| 4134 float device_scale_factor = 2.5f; | 4134 float device_scale_factor = 2.5f; |
| 4135 float page_scale_factor = 1.f; | 4135 float page_scale_factor = 1.f; |
| 4136 | 4136 |
| 4137 RenderSurfaceLayerList render_surface_layer_list; | 4137 RenderSurfaceLayerList render_surface_layer_list; |
| 4138 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 4138 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 4139 parent.get(), parent->bounds(), &render_surface_layer_list); | 4139 parent.get(), parent->bounds(), &render_surface_layer_list); |
| 4140 inputs.device_scale_factor = device_scale_factor; | 4140 inputs.device_scale_factor = device_scale_factor; |
| 4141 inputs.page_scale_factor = page_scale_factor; | 4141 inputs.page_scale_factor = page_scale_factor; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4259 false, | 4259 false, |
| 4260 true); | 4260 true); |
| 4261 | 4261 |
| 4262 perspective_surface->SetForceRenderSurface(true); | 4262 perspective_surface->SetForceRenderSurface(true); |
| 4263 scale_surface->SetForceRenderSurface(true); | 4263 scale_surface->SetForceRenderSurface(true); |
| 4264 | 4264 |
| 4265 parent->AddChild(perspective_surface); | 4265 parent->AddChild(perspective_surface); |
| 4266 parent->AddChild(scale_surface); | 4266 parent->AddChild(scale_surface); |
| 4267 root->AddChild(parent); | 4267 root->AddChild(parent); |
| 4268 | 4268 |
| 4269 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4269 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 4270 host->SetRootLayer(root); | 4270 host->SetRootLayer(root); |
| 4271 | 4271 |
| 4272 float device_scale_factor = 2.5f; | 4272 float device_scale_factor = 2.5f; |
| 4273 float page_scale_factor = 3.f; | 4273 float page_scale_factor = 3.f; |
| 4274 | 4274 |
| 4275 RenderSurfaceLayerList render_surface_layer_list; | 4275 RenderSurfaceLayerList render_surface_layer_list; |
| 4276 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 4276 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 4277 root.get(), parent->bounds(), &render_surface_layer_list); | 4277 root.get(), parent->bounds(), &render_surface_layer_list); |
| 4278 inputs.device_scale_factor = device_scale_factor; | 4278 inputs.device_scale_factor = device_scale_factor; |
| 4279 inputs.page_scale_factor = page_scale_factor; | 4279 inputs.page_scale_factor = page_scale_factor; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4358 identity_matrix, | 4358 identity_matrix, |
| 4359 gfx::Point3F(), | 4359 gfx::Point3F(), |
| 4360 gfx::PointF(), | 4360 gfx::PointF(), |
| 4361 gfx::Size(13, 13), | 4361 gfx::Size(13, 13), |
| 4362 false, | 4362 false, |
| 4363 true); | 4363 true); |
| 4364 | 4364 |
| 4365 parent->AddChild(child); | 4365 parent->AddChild(child); |
| 4366 parent->AddChild(child_no_scale); | 4366 parent->AddChild(child_no_scale); |
| 4367 | 4367 |
| 4368 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4368 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 4369 host->SetRootLayer(parent); | 4369 host->SetRootLayer(parent); |
| 4370 | 4370 |
| 4371 float device_scale_factor = 1.7f; | 4371 float device_scale_factor = 1.7f; |
| 4372 float page_scale_factor = 1.f; | 4372 float page_scale_factor = 1.f; |
| 4373 | 4373 |
| 4374 RenderSurfaceLayerList render_surface_layer_list; | 4374 RenderSurfaceLayerList render_surface_layer_list; |
| 4375 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 4375 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 4376 parent.get(), parent->bounds(), &render_surface_layer_list); | 4376 parent.get(), parent->bounds(), &render_surface_layer_list); |
| 4377 inputs.device_scale_factor = device_scale_factor; | 4377 inputs.device_scale_factor = device_scale_factor; |
| 4378 inputs.page_scale_factor = page_scale_factor; | 4378 inputs.page_scale_factor = page_scale_factor; |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4496 gfx::Size(10, 10), | 4496 gfx::Size(10, 10), |
| 4497 false, | 4497 false, |
| 4498 true); | 4498 true); |
| 4499 | 4499 |
| 4500 root->AddChild(parent); | 4500 root->AddChild(parent); |
| 4501 | 4501 |
| 4502 parent->AddChild(child_scale); | 4502 parent->AddChild(child_scale); |
| 4503 parent->AddChild(child_empty); | 4503 parent->AddChild(child_empty); |
| 4504 parent->AddChild(child_no_scale); | 4504 parent->AddChild(child_no_scale); |
| 4505 | 4505 |
| 4506 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4506 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 4507 host->SetRootLayer(root); | 4507 host->SetRootLayer(root); |
| 4508 | 4508 |
| 4509 float device_scale_factor = 2.5f; | 4509 float device_scale_factor = 2.5f; |
| 4510 float page_scale_factor = 1.f; | 4510 float page_scale_factor = 1.f; |
| 4511 | 4511 |
| 4512 { | 4512 { |
| 4513 RenderSurfaceLayerList render_surface_layer_list; | 4513 RenderSurfaceLayerList render_surface_layer_list; |
| 4514 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 4514 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 4515 root.get(), root->bounds(), &render_surface_layer_list); | 4515 root.get(), root->bounds(), &render_surface_layer_list); |
| 4516 inputs.device_scale_factor = device_scale_factor; | 4516 inputs.device_scale_factor = device_scale_factor; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4680 gfx::Size(10, 10), | 4680 gfx::Size(10, 10), |
| 4681 false, | 4681 false, |
| 4682 true); | 4682 true); |
| 4683 | 4683 |
| 4684 root->AddChild(parent); | 4684 root->AddChild(parent); |
| 4685 | 4685 |
| 4686 parent->AddChild(child_scale); | 4686 parent->AddChild(child_scale); |
| 4687 parent->AddChild(child_empty); | 4687 parent->AddChild(child_empty); |
| 4688 parent->AddChild(child_no_scale); | 4688 parent->AddChild(child_no_scale); |
| 4689 | 4689 |
| 4690 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4690 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 4691 host->SetRootLayer(root); | 4691 host->SetRootLayer(root); |
| 4692 | 4692 |
| 4693 RenderSurfaceLayerList render_surface_layer_list; | 4693 RenderSurfaceLayerList render_surface_layer_list; |
| 4694 | 4694 |
| 4695 float device_scale_factor = 2.5f; | 4695 float device_scale_factor = 2.5f; |
| 4696 float page_scale_factor = 1.f; | 4696 float page_scale_factor = 1.f; |
| 4697 | 4697 |
| 4698 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 4698 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 4699 root.get(), root->bounds(), &render_surface_layer_list); | 4699 root.get(), root->bounds(), &render_surface_layer_list); |
| 4700 inputs.device_scale_factor = device_scale_factor; | 4700 inputs.device_scale_factor = device_scale_factor; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4762 gfx::Point3F(), | 4762 gfx::Point3F(), |
| 4763 gfx::PointF(2.f, 2.f), | 4763 gfx::PointF(2.f, 2.f), |
| 4764 gfx::Size(10, 10), | 4764 gfx::Size(10, 10), |
| 4765 false, | 4765 false, |
| 4766 true); | 4766 true); |
| 4767 | 4767 |
| 4768 root->AddChild(parent); | 4768 root->AddChild(parent); |
| 4769 | 4769 |
| 4770 parent->AddChild(child_scale); | 4770 parent->AddChild(child_scale); |
| 4771 | 4771 |
| 4772 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4772 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 4773 host->SetRootLayer(root); | 4773 host->SetRootLayer(root); |
| 4774 | 4774 |
| 4775 float device_scale_factor = 2.5f; | 4775 float device_scale_factor = 2.5f; |
| 4776 float page_scale_factor = 0.01f; | 4776 float page_scale_factor = 0.01f; |
| 4777 | 4777 |
| 4778 { | 4778 { |
| 4779 RenderSurfaceLayerList render_surface_layer_list; | 4779 RenderSurfaceLayerList render_surface_layer_list; |
| 4780 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 4780 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 4781 root.get(), root->bounds(), &render_surface_layer_list); | 4781 root.get(), root->bounds(), &render_surface_layer_list); |
| 4782 inputs.device_scale_factor = device_scale_factor; | 4782 inputs.device_scale_factor = device_scale_factor; |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4910 parent->AddChild(surface_no_scale); | 4910 parent->AddChild(surface_no_scale); |
| 4911 | 4911 |
| 4912 surface_scale->SetForceRenderSurface(true); | 4912 surface_scale->SetForceRenderSurface(true); |
| 4913 surface_scale->AddChild(surface_scale_child_scale); | 4913 surface_scale->AddChild(surface_scale_child_scale); |
| 4914 surface_scale->AddChild(surface_scale_child_no_scale); | 4914 surface_scale->AddChild(surface_scale_child_no_scale); |
| 4915 | 4915 |
| 4916 surface_no_scale->SetForceRenderSurface(true); | 4916 surface_no_scale->SetForceRenderSurface(true); |
| 4917 surface_no_scale->AddChild(surface_no_scale_child_scale); | 4917 surface_no_scale->AddChild(surface_no_scale_child_scale); |
| 4918 surface_no_scale->AddChild(surface_no_scale_child_no_scale); | 4918 surface_no_scale->AddChild(surface_no_scale_child_no_scale); |
| 4919 | 4919 |
| 4920 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 4920 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 4921 host->SetRootLayer(root); | 4921 host->SetRootLayer(root); |
| 4922 | 4922 |
| 4923 SkMScalar device_scale_factor = 5; | 4923 SkMScalar device_scale_factor = 5; |
| 4924 SkMScalar page_scale_factor = 7; | 4924 SkMScalar page_scale_factor = 7; |
| 4925 | 4925 |
| 4926 RenderSurfaceLayerList render_surface_layer_list; | 4926 RenderSurfaceLayerList render_surface_layer_list; |
| 4927 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 4927 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 4928 root.get(), root->bounds(), &render_surface_layer_list); | 4928 root.get(), root->bounds(), &render_surface_layer_list); |
| 4929 inputs.device_scale_factor = device_scale_factor; | 4929 inputs.device_scale_factor = device_scale_factor; |
| 4930 inputs.page_scale_factor = page_scale_factor; | 4930 inputs.page_scale_factor = page_scale_factor; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5111 parent->AddChild(surface_no_scale); | 5111 parent->AddChild(surface_no_scale); |
| 5112 | 5112 |
| 5113 surface_scale->SetForceRenderSurface(true); | 5113 surface_scale->SetForceRenderSurface(true); |
| 5114 surface_scale->AddChild(surface_scale_child_scale); | 5114 surface_scale->AddChild(surface_scale_child_scale); |
| 5115 surface_scale->AddChild(surface_scale_child_no_scale); | 5115 surface_scale->AddChild(surface_scale_child_no_scale); |
| 5116 | 5116 |
| 5117 surface_no_scale->SetForceRenderSurface(true); | 5117 surface_no_scale->SetForceRenderSurface(true); |
| 5118 surface_no_scale->AddChild(surface_no_scale_child_scale); | 5118 surface_no_scale->AddChild(surface_no_scale_child_scale); |
| 5119 surface_no_scale->AddChild(surface_no_scale_child_no_scale); | 5119 surface_no_scale->AddChild(surface_no_scale_child_no_scale); |
| 5120 | 5120 |
| 5121 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5121 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5122 host->SetRootLayer(root); | 5122 host->SetRootLayer(root); |
| 5123 | 5123 |
| 5124 RenderSurfaceLayerList render_surface_layer_list; | 5124 RenderSurfaceLayerList render_surface_layer_list; |
| 5125 | 5125 |
| 5126 SkMScalar device_scale_factor = 5.0; | 5126 SkMScalar device_scale_factor = 5.0; |
| 5127 SkMScalar page_scale_factor = 7.0; | 5127 SkMScalar page_scale_factor = 7.0; |
| 5128 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 5128 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 5129 root.get(), root->bounds(), &render_surface_layer_list); | 5129 root.get(), root->bounds(), &render_surface_layer_list); |
| 5130 inputs.device_scale_factor = device_scale_factor; | 5130 inputs.device_scale_factor = device_scale_factor; |
| 5131 inputs.page_scale_factor = page_scale_factor; | 5131 inputs.page_scale_factor = page_scale_factor; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5254 gfx::Point3F(), | 5254 gfx::Point3F(), |
| 5255 gfx::PointF(2.f, 2.f), | 5255 gfx::PointF(2.f, 2.f), |
| 5256 gfx::Size(10, 10), | 5256 gfx::Size(10, 10), |
| 5257 false, | 5257 false, |
| 5258 true); | 5258 true); |
| 5259 | 5259 |
| 5260 root->AddChild(parent); | 5260 root->AddChild(parent); |
| 5261 | 5261 |
| 5262 parent->AddChild(child_scale); | 5262 parent->AddChild(child_scale); |
| 5263 | 5263 |
| 5264 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5264 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5265 host->SetRootLayer(root); | 5265 host->SetRootLayer(root); |
| 5266 | 5266 |
| 5267 // Now put an animating transform on child. | 5267 // Now put an animating transform on child. |
| 5268 int animation_id = AddAnimatedTransformToController( | 5268 int animation_id = AddAnimatedTransformToController( |
| 5269 child_scale->layer_animation_controller(), 10.0, 30, 0); | 5269 child_scale->layer_animation_controller(), 10.0, 30, 0); |
| 5270 | 5270 |
| 5271 { | 5271 { |
| 5272 RenderSurfaceLayerList render_surface_layer_list; | 5272 RenderSurfaceLayerList render_surface_layer_list; |
| 5273 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 5273 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 5274 root.get(), root->bounds(), &render_surface_layer_list); | 5274 root.get(), root->bounds(), &render_surface_layer_list); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 5299 } | 5299 } |
| 5300 } | 5300 } |
| 5301 | 5301 |
| 5302 TEST_F(LayerTreeHostCommonTest, | 5302 TEST_F(LayerTreeHostCommonTest, |
| 5303 ChangeInContentBoundsOrScaleTriggersPushProperties) { | 5303 ChangeInContentBoundsOrScaleTriggersPushProperties) { |
| 5304 MockContentLayerClient delegate; | 5304 MockContentLayerClient delegate; |
| 5305 scoped_refptr<Layer> root = Layer::Create(); | 5305 scoped_refptr<Layer> root = Layer::Create(); |
| 5306 scoped_refptr<Layer> child = CreateDrawableContentLayer(&delegate); | 5306 scoped_refptr<Layer> child = CreateDrawableContentLayer(&delegate); |
| 5307 root->AddChild(child); | 5307 root->AddChild(child); |
| 5308 | 5308 |
| 5309 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5309 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5310 host->SetRootLayer(root); | 5310 host->SetRootLayer(root); |
| 5311 | 5311 |
| 5312 gfx::Transform identity_matrix; | 5312 gfx::Transform identity_matrix; |
| 5313 SetLayerPropertiesForTesting(root.get(), | 5313 SetLayerPropertiesForTesting(root.get(), |
| 5314 identity_matrix, | 5314 identity_matrix, |
| 5315 gfx::Point3F(), | 5315 gfx::Point3F(), |
| 5316 gfx::PointF(), | 5316 gfx::PointF(), |
| 5317 gfx::Size(100, 100), | 5317 gfx::Size(100, 100), |
| 5318 true, | 5318 true, |
| 5319 false); | 5319 false); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5393 gfx::Point3F(), | 5393 gfx::Point3F(), |
| 5394 gfx::PointF(), | 5394 gfx::PointF(), |
| 5395 gfx::Size(10, 10), | 5395 gfx::Size(10, 10), |
| 5396 false, | 5396 false, |
| 5397 true); | 5397 true); |
| 5398 | 5398 |
| 5399 parent->AddChild(child); | 5399 parent->AddChild(child); |
| 5400 child->AddChild(duplicate_child_non_owner); | 5400 child->AddChild(duplicate_child_non_owner); |
| 5401 child->SetReplicaLayer(replica.get()); | 5401 child->SetReplicaLayer(replica.get()); |
| 5402 | 5402 |
| 5403 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5403 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5404 host->SetRootLayer(parent); | 5404 host->SetRootLayer(parent); |
| 5405 | 5405 |
| 5406 RenderSurfaceLayerList render_surface_layer_list; | 5406 RenderSurfaceLayerList render_surface_layer_list; |
| 5407 | 5407 |
| 5408 float device_scale_factor = 1.5f; | 5408 float device_scale_factor = 1.5f; |
| 5409 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 5409 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 5410 parent.get(), parent->bounds(), &render_surface_layer_list); | 5410 parent.get(), parent->bounds(), &render_surface_layer_list); |
| 5411 inputs.device_scale_factor = device_scale_factor; | 5411 inputs.device_scale_factor = device_scale_factor; |
| 5412 inputs.can_adjust_raster_scales = true; | 5412 inputs.can_adjust_raster_scales = true; |
| 5413 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 5413 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5528 gfx::Point3F(), | 5528 gfx::Point3F(), |
| 5529 gfx::PointF(), | 5529 gfx::PointF(), |
| 5530 gfx::Size(13, 11), | 5530 gfx::Size(13, 11), |
| 5531 false, | 5531 false, |
| 5532 true); | 5532 true); |
| 5533 | 5533 |
| 5534 parent->AddChild(child); | 5534 parent->AddChild(child); |
| 5535 child->AddChild(duplicate_child_non_owner); | 5535 child->AddChild(duplicate_child_non_owner); |
| 5536 child->SetReplicaLayer(replica.get()); | 5536 child->SetReplicaLayer(replica.get()); |
| 5537 | 5537 |
| 5538 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5538 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5539 host->SetRootLayer(parent); | 5539 host->SetRootLayer(parent); |
| 5540 | 5540 |
| 5541 float device_scale_factor = 1.7f; | 5541 float device_scale_factor = 1.7f; |
| 5542 | 5542 |
| 5543 RenderSurfaceLayerList render_surface_layer_list; | 5543 RenderSurfaceLayerList render_surface_layer_list; |
| 5544 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 5544 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 5545 parent.get(), parent->bounds(), &render_surface_layer_list); | 5545 parent.get(), parent->bounds(), &render_surface_layer_list); |
| 5546 inputs.device_scale_factor = device_scale_factor; | 5546 inputs.device_scale_factor = device_scale_factor; |
| 5547 inputs.can_adjust_raster_scales = true; | 5547 inputs.can_adjust_raster_scales = true; |
| 5548 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 5548 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5593 scoped_refptr<Layer> child = Layer::Create(); | 5593 scoped_refptr<Layer> child = Layer::Create(); |
| 5594 scoped_refptr<Layer> grand_child = Layer::Create(); | 5594 scoped_refptr<Layer> grand_child = Layer::Create(); |
| 5595 scoped_refptr<Layer> mask_layer = Layer::Create(); | 5595 scoped_refptr<Layer> mask_layer = Layer::Create(); |
| 5596 scoped_refptr<Layer> replica_layer = Layer::Create(); | 5596 scoped_refptr<Layer> replica_layer = Layer::Create(); |
| 5597 | 5597 |
| 5598 grand_child->SetReplicaLayer(replica_layer.get()); | 5598 grand_child->SetReplicaLayer(replica_layer.get()); |
| 5599 child->AddChild(grand_child.get()); | 5599 child->AddChild(grand_child.get()); |
| 5600 child->SetMaskLayer(mask_layer.get()); | 5600 child->SetMaskLayer(mask_layer.get()); |
| 5601 root->AddChild(child.get()); | 5601 root->AddChild(child.get()); |
| 5602 | 5602 |
| 5603 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5603 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5604 host->SetRootLayer(root); | 5604 host->SetRootLayer(root); |
| 5605 | 5605 |
| 5606 int nonexistent_id = -1; | 5606 int nonexistent_id = -1; |
| 5607 EXPECT_EQ(root, | 5607 EXPECT_EQ(root, |
| 5608 LayerTreeHostCommon::FindLayerInSubtree(root.get(), root->id())); | 5608 LayerTreeHostCommon::FindLayerInSubtree(root.get(), root->id())); |
| 5609 EXPECT_EQ(child, | 5609 EXPECT_EQ(child, |
| 5610 LayerTreeHostCommon::FindLayerInSubtree(root.get(), child->id())); | 5610 LayerTreeHostCommon::FindLayerInSubtree(root.get(), child->id())); |
| 5611 EXPECT_EQ( | 5611 EXPECT_EQ( |
| 5612 grand_child, | 5612 grand_child, |
| 5613 LayerTreeHostCommon::FindLayerInSubtree(root.get(), grand_child->id())); | 5613 LayerTreeHostCommon::FindLayerInSubtree(root.get(), grand_child->id())); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5647 gfx::Point3F(), | 5647 gfx::Point3F(), |
| 5648 gfx::PointF(), | 5648 gfx::PointF(), |
| 5649 gfx::Size(10, 10), | 5649 gfx::Size(10, 10), |
| 5650 true, | 5650 true, |
| 5651 false); | 5651 false); |
| 5652 | 5652 |
| 5653 root->AddChild(child); | 5653 root->AddChild(child); |
| 5654 child->AddChild(grand_child); | 5654 child->AddChild(grand_child); |
| 5655 child->SetOpacity(0.5f); | 5655 child->SetOpacity(0.5f); |
| 5656 | 5656 |
| 5657 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5657 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5658 host->SetRootLayer(root); | 5658 host->SetRootLayer(root); |
| 5659 | 5659 |
| 5660 ExecuteCalculateDrawProperties(root.get()); | 5660 ExecuteCalculateDrawProperties(root.get()); |
| 5661 | 5661 |
| 5662 EXPECT_FALSE(child->render_surface()); | 5662 EXPECT_FALSE(child->render_surface()); |
| 5663 } | 5663 } |
| 5664 | 5664 |
| 5665 TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) { | 5665 TEST_F(LayerTreeHostCommonTest, OpacityAnimatingOnPendingTree) { |
| 5666 FakeImplProxy proxy; | 5666 FakeImplProxy proxy; |
| 5667 TestSharedBitmapManager shared_bitmap_manager; | 5667 TestSharedBitmapManager shared_bitmap_manager; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5740 SetLayerPropertiesForTesting(grand_child_.get(), | 5740 SetLayerPropertiesForTesting(grand_child_.get(), |
| 5741 identity_matrix, | 5741 identity_matrix, |
| 5742 gfx::Point3F(), | 5742 gfx::Point3F(), |
| 5743 gfx::PointF(), | 5743 gfx::PointF(), |
| 5744 gfx::Size(1, 1), | 5744 gfx::Size(1, 1), |
| 5745 true, | 5745 true, |
| 5746 false); | 5746 false); |
| 5747 | 5747 |
| 5748 child_->SetForceRenderSurface(std::tr1::get<1>(GetParam())); | 5748 child_->SetForceRenderSurface(std::tr1::get<1>(GetParam())); |
| 5749 | 5749 |
| 5750 host_ = FakeLayerTreeHost::Create(); | 5750 host_ = CreateFakeLayerTreeHost(); |
| 5751 host_->SetRootLayer(root_); | 5751 host_->SetRootLayer(root_); |
| 5752 } | 5752 } |
| 5753 | 5753 |
| 5754 bool can_use_lcd_text_; | 5754 bool can_use_lcd_text_; |
| 5755 scoped_ptr<FakeLayerTreeHost> host_; | 5755 scoped_ptr<FakeLayerTreeHost> host_; |
| 5756 scoped_refptr<Layer> root_; | 5756 scoped_refptr<Layer> root_; |
| 5757 scoped_refptr<Layer> child_; | 5757 scoped_refptr<Layer> child_; |
| 5758 scoped_refptr<Layer> grand_child_; | 5758 scoped_refptr<Layer> grand_child_; |
| 5759 }; | 5759 }; |
| 5760 | 5760 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5896 gfx::PointF(), | 5896 gfx::PointF(), |
| 5897 gfx::Size(30, 30), | 5897 gfx::Size(30, 30), |
| 5898 true, | 5898 true, |
| 5899 false); | 5899 false); |
| 5900 grand_child->SetIsDrawable(true); | 5900 grand_child->SetIsDrawable(true); |
| 5901 grand_child->SetHideLayerAndSubtree(true); | 5901 grand_child->SetHideLayerAndSubtree(true); |
| 5902 | 5902 |
| 5903 child->AddChild(grand_child); | 5903 child->AddChild(grand_child); |
| 5904 root->AddChild(child); | 5904 root->AddChild(child); |
| 5905 | 5905 |
| 5906 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 5906 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 5907 host->SetRootLayer(root); | 5907 host->SetRootLayer(root); |
| 5908 | 5908 |
| 5909 RenderSurfaceLayerList render_surface_layer_list; | 5909 RenderSurfaceLayerList render_surface_layer_list; |
| 5910 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 5910 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 5911 root.get(), root->bounds(), &render_surface_layer_list); | 5911 root.get(), root->bounds(), &render_surface_layer_list); |
| 5912 inputs.can_adjust_raster_scales = true; | 5912 inputs.can_adjust_raster_scales = true; |
| 5913 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 5913 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 5914 | 5914 |
| 5915 // We should have one render surface and two layers. The grand child has | 5915 // We should have one render surface and two layers. The grand child has |
| 5916 // hidden itself. | 5916 // hidden itself. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6010 gfx::Point3F(), | 6010 gfx::Point3F(), |
| 6011 gfx::PointF(), | 6011 gfx::PointF(), |
| 6012 gfx::Size(30, 30), | 6012 gfx::Size(30, 30), |
| 6013 true, | 6013 true, |
| 6014 false); | 6014 false); |
| 6015 grand_child->SetIsDrawable(true); | 6015 grand_child->SetIsDrawable(true); |
| 6016 | 6016 |
| 6017 child->AddChild(grand_child); | 6017 child->AddChild(grand_child); |
| 6018 root->AddChild(child); | 6018 root->AddChild(child); |
| 6019 | 6019 |
| 6020 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6020 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6021 host->SetRootLayer(root); | 6021 host->SetRootLayer(root); |
| 6022 | 6022 |
| 6023 RenderSurfaceLayerList render_surface_layer_list; | 6023 RenderSurfaceLayerList render_surface_layer_list; |
| 6024 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 6024 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 6025 root.get(), root->bounds(), &render_surface_layer_list); | 6025 root.get(), root->bounds(), &render_surface_layer_list); |
| 6026 inputs.can_adjust_raster_scales = true; | 6026 inputs.can_adjust_raster_scales = true; |
| 6027 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 6027 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 6028 | 6028 |
| 6029 // We should have one render surface and one layers. The child has | 6029 // We should have one render surface and one layers. The child has |
| 6030 // hidden itself and the grand child. | 6030 // hidden itself and the grand child. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6168 false); | 6168 false); |
| 6169 copy_grand_parent_sibling_after->SetIsDrawable(true); | 6169 copy_grand_parent_sibling_after->SetIsDrawable(true); |
| 6170 | 6170 |
| 6171 copy_layer->AddChild(copy_child); | 6171 copy_layer->AddChild(copy_child); |
| 6172 copy_parent->AddChild(copy_layer); | 6172 copy_parent->AddChild(copy_layer); |
| 6173 copy_grand_parent->AddChild(copy_parent); | 6173 copy_grand_parent->AddChild(copy_parent); |
| 6174 root->AddChild(copy_grand_parent_sibling_before); | 6174 root->AddChild(copy_grand_parent_sibling_before); |
| 6175 root->AddChild(copy_grand_parent); | 6175 root->AddChild(copy_grand_parent); |
| 6176 root->AddChild(copy_grand_parent_sibling_after); | 6176 root->AddChild(copy_grand_parent_sibling_after); |
| 6177 | 6177 |
| 6178 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6178 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6179 host->SetRootLayer(root); | 6179 host->SetRootLayer(root); |
| 6180 | 6180 |
| 6181 // Hide the copy_grand_parent and its subtree. But make a copy request in that | 6181 // Hide the copy_grand_parent and its subtree. But make a copy request in that |
| 6182 // hidden subtree on copy_layer. | 6182 // hidden subtree on copy_layer. |
| 6183 copy_grand_parent->SetHideLayerAndSubtree(true); | 6183 copy_grand_parent->SetHideLayerAndSubtree(true); |
| 6184 copy_grand_parent_sibling_before->SetHideLayerAndSubtree(true); | 6184 copy_grand_parent_sibling_before->SetHideLayerAndSubtree(true); |
| 6185 copy_grand_parent_sibling_after->SetHideLayerAndSubtree(true); | 6185 copy_grand_parent_sibling_after->SetHideLayerAndSubtree(true); |
| 6186 copy_layer->RequestCopyOfOutput(CopyOutputRequest::CreateRequest( | 6186 copy_layer->RequestCopyOfOutput(CopyOutputRequest::CreateRequest( |
| 6187 base::Bind(&EmptyCopyOutputCallback))); | 6187 base::Bind(&EmptyCopyOutputCallback))); |
| 6188 EXPECT_TRUE(copy_layer->HasCopyRequest()); | 6188 EXPECT_TRUE(copy_layer->HasCopyRequest()); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6282 gfx::PointF(), | 6282 gfx::PointF(), |
| 6283 gfx::Size(20, 20), | 6283 gfx::Size(20, 20), |
| 6284 true, | 6284 true, |
| 6285 false); | 6285 false); |
| 6286 copy_child->SetIsDrawable(true); | 6286 copy_child->SetIsDrawable(true); |
| 6287 | 6287 |
| 6288 copy_layer->AddChild(copy_child); | 6288 copy_layer->AddChild(copy_child); |
| 6289 copy_parent->AddChild(copy_layer); | 6289 copy_parent->AddChild(copy_layer); |
| 6290 root->AddChild(copy_parent); | 6290 root->AddChild(copy_parent); |
| 6291 | 6291 |
| 6292 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6292 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6293 host->SetRootLayer(root); | 6293 host->SetRootLayer(root); |
| 6294 | 6294 |
| 6295 copy_layer->RequestCopyOfOutput(CopyOutputRequest::CreateRequest( | 6295 copy_layer->RequestCopyOfOutput(CopyOutputRequest::CreateRequest( |
| 6296 base::Bind(&EmptyCopyOutputCallback))); | 6296 base::Bind(&EmptyCopyOutputCallback))); |
| 6297 EXPECT_TRUE(copy_layer->HasCopyRequest()); | 6297 EXPECT_TRUE(copy_layer->HasCopyRequest()); |
| 6298 | 6298 |
| 6299 RenderSurfaceLayerList render_surface_layer_list; | 6299 RenderSurfaceLayerList render_surface_layer_list; |
| 6300 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 6300 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 6301 root.get(), root->bounds(), &render_surface_layer_list); | 6301 root.get(), root->bounds(), &render_surface_layer_list); |
| 6302 inputs.can_adjust_raster_scales = true; | 6302 inputs.can_adjust_raster_scales = true; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6346 gfx::Point3F(), | 6346 gfx::Point3F(), |
| 6347 gfx::PointF(), | 6347 gfx::PointF(), |
| 6348 gfx::Size(50, 50), | 6348 gfx::Size(50, 50), |
| 6349 true, | 6349 true, |
| 6350 false); | 6350 false); |
| 6351 surface_child->SetIsDrawable(true); | 6351 surface_child->SetIsDrawable(true); |
| 6352 | 6352 |
| 6353 surface->AddChild(surface_child); | 6353 surface->AddChild(surface_child); |
| 6354 root->AddChild(surface); | 6354 root->AddChild(surface); |
| 6355 | 6355 |
| 6356 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6356 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6357 host->SetRootLayer(root); | 6357 host->SetRootLayer(root); |
| 6358 | 6358 |
| 6359 RenderSurfaceLayerList render_surface_layer_list; | 6359 RenderSurfaceLayerList render_surface_layer_list; |
| 6360 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 6360 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 6361 root.get(), root->bounds(), &render_surface_layer_list); | 6361 root.get(), root->bounds(), &render_surface_layer_list); |
| 6362 inputs.can_adjust_raster_scales = true; | 6362 inputs.can_adjust_raster_scales = true; |
| 6363 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 6363 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| 6364 | 6364 |
| 6365 // The visible_content_rect for the |surface_child| should not be clipped by | 6365 // The visible_content_rect for the |surface_child| should not be clipped by |
| 6366 // the viewport. | 6366 // the viewport. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6433 true, | 6433 true, |
| 6434 false); | 6434 false); |
| 6435 SetLayerPropertiesForTesting(clip_child.get(), | 6435 SetLayerPropertiesForTesting(clip_child.get(), |
| 6436 identity_transform, | 6436 identity_transform, |
| 6437 gfx::Point3F(), | 6437 gfx::Point3F(), |
| 6438 gfx::PointF(1.f, 1.f), | 6438 gfx::PointF(1.f, 1.f), |
| 6439 gfx::Size(10, 10), | 6439 gfx::Size(10, 10), |
| 6440 true, | 6440 true, |
| 6441 false); | 6441 false); |
| 6442 | 6442 |
| 6443 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6443 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6444 host->SetRootLayer(root); | 6444 host->SetRootLayer(root); |
| 6445 | 6445 |
| 6446 ExecuteCalculateDrawProperties(root.get()); | 6446 ExecuteCalculateDrawProperties(root.get()); |
| 6447 | 6447 |
| 6448 ASSERT_TRUE(root->render_surface()); | 6448 ASSERT_TRUE(root->render_surface()); |
| 6449 ASSERT_TRUE(render_surface->render_surface()); | 6449 ASSERT_TRUE(render_surface->render_surface()); |
| 6450 | 6450 |
| 6451 // Ensure that we've inherited our clip parent's clip and weren't affected | 6451 // Ensure that we've inherited our clip parent's clip and weren't affected |
| 6452 // by the intervening clip layer. | 6452 // by the intervening clip layer. |
| 6453 ASSERT_EQ(gfx::Rect(1, 1, 20, 20).ToString(), | 6453 ASSERT_EQ(gfx::Rect(1, 1, 20, 20).ToString(), |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6544 true, | 6544 true, |
| 6545 false); | 6545 false); |
| 6546 SetLayerPropertiesForTesting(clip_child.get(), | 6546 SetLayerPropertiesForTesting(clip_child.get(), |
| 6547 identity_transform, | 6547 identity_transform, |
| 6548 gfx::Point3F(), | 6548 gfx::Point3F(), |
| 6549 gfx::PointF(-10.f, -10.f), | 6549 gfx::PointF(-10.f, -10.f), |
| 6550 gfx::Size(60, 60), | 6550 gfx::Size(60, 60), |
| 6551 true, | 6551 true, |
| 6552 false); | 6552 false); |
| 6553 | 6553 |
| 6554 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6554 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6555 host->SetRootLayer(root); | 6555 host->SetRootLayer(root); |
| 6556 | 6556 |
| 6557 ExecuteCalculateDrawProperties(root.get()); | 6557 ExecuteCalculateDrawProperties(root.get()); |
| 6558 | 6558 |
| 6559 EXPECT_TRUE(root->render_surface()); | 6559 EXPECT_TRUE(root->render_surface()); |
| 6560 EXPECT_TRUE(render_surface1->render_surface()); | 6560 EXPECT_TRUE(render_surface1->render_surface()); |
| 6561 EXPECT_TRUE(render_surface2->render_surface()); | 6561 EXPECT_TRUE(render_surface2->render_surface()); |
| 6562 | 6562 |
| 6563 // Since the render surfaces could have expanded, they should not clip (their | 6563 // Since the render surfaces could have expanded, they should not clip (their |
| 6564 // bounds would no longer be reliable). We should resort to layer clipping | 6564 // bounds would no longer be reliable). We should resort to layer clipping |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6673 true, | 6673 true, |
| 6674 false); | 6674 false); |
| 6675 SetLayerPropertiesForTesting(clip_child.get(), | 6675 SetLayerPropertiesForTesting(clip_child.get(), |
| 6676 identity_transform, | 6676 identity_transform, |
| 6677 gfx::Point3F(), | 6677 gfx::Point3F(), |
| 6678 gfx::PointF(-10.f, -10.f), | 6678 gfx::PointF(-10.f, -10.f), |
| 6679 gfx::Size(60, 60), | 6679 gfx::Size(60, 60), |
| 6680 true, | 6680 true, |
| 6681 false); | 6681 false); |
| 6682 | 6682 |
| 6683 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6683 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6684 host->SetRootLayer(root); | 6684 host->SetRootLayer(root); |
| 6685 | 6685 |
| 6686 ExecuteCalculateDrawProperties(root.get()); | 6686 ExecuteCalculateDrawProperties(root.get()); |
| 6687 | 6687 |
| 6688 EXPECT_TRUE(root->render_surface()); | 6688 EXPECT_TRUE(root->render_surface()); |
| 6689 EXPECT_TRUE(render_surface1->render_surface()); | 6689 EXPECT_TRUE(render_surface1->render_surface()); |
| 6690 EXPECT_TRUE(render_surface2->render_surface()); | 6690 EXPECT_TRUE(render_surface2->render_surface()); |
| 6691 | 6691 |
| 6692 // Since the render surfaces could have expanded, they should not clip (their | 6692 // Since the render surfaces could have expanded, they should not clip (their |
| 6693 // bounds would no longer be reliable). We should resort to layer clipping | 6693 // bounds would no longer be reliable). We should resort to layer clipping |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6782 true, | 6782 true, |
| 6783 false); | 6783 false); |
| 6784 SetLayerPropertiesForTesting(child.get(), | 6784 SetLayerPropertiesForTesting(child.get(), |
| 6785 identity_transform, | 6785 identity_transform, |
| 6786 gfx::Point3F(), | 6786 gfx::Point3F(), |
| 6787 gfx::PointF(), | 6787 gfx::PointF(), |
| 6788 gfx::Size(60, 60), | 6788 gfx::Size(60, 60), |
| 6789 true, | 6789 true, |
| 6790 false); | 6790 false); |
| 6791 | 6791 |
| 6792 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6792 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6793 host->SetRootLayer(root); | 6793 host->SetRootLayer(root); |
| 6794 | 6794 |
| 6795 ExecuteCalculateDrawProperties(root.get()); | 6795 ExecuteCalculateDrawProperties(root.get()); |
| 6796 | 6796 |
| 6797 EXPECT_TRUE(root->render_surface()); | 6797 EXPECT_TRUE(root->render_surface()); |
| 6798 | 6798 |
| 6799 // Neither the clip child nor its descendant should have inherited the clip | 6799 // Neither the clip child nor its descendant should have inherited the clip |
| 6800 // from |intervening|. | 6800 // from |intervening|. |
| 6801 EXPECT_EQ(gfx::Rect(0, 0, 40, 40).ToString(), | 6801 EXPECT_EQ(gfx::Rect(0, 0, 40, 40).ToString(), |
| 6802 clip_child->clip_rect().ToString()); | 6802 clip_child->clip_rect().ToString()); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6879 identity_transform, | 6879 identity_transform, |
| 6880 gfx::Point3F(), | 6880 gfx::Point3F(), |
| 6881 gfx::PointF(), | 6881 gfx::PointF(), |
| 6882 gfx::Size(5, 5), | 6882 gfx::Size(5, 5), |
| 6883 true, | 6883 true, |
| 6884 false); | 6884 false); |
| 6885 | 6885 |
| 6886 render_surface1->SetForceRenderSurface(true); | 6886 render_surface1->SetForceRenderSurface(true); |
| 6887 render_surface2->SetForceRenderSurface(true); | 6887 render_surface2->SetForceRenderSurface(true); |
| 6888 | 6888 |
| 6889 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 6889 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 6890 host->SetRootLayer(root); | 6890 host->SetRootLayer(root); |
| 6891 | 6891 |
| 6892 ExecuteCalculateDrawProperties(root.get()); | 6892 ExecuteCalculateDrawProperties(root.get()); |
| 6893 | 6893 |
| 6894 EXPECT_TRUE(root->render_surface()); | 6894 EXPECT_TRUE(root->render_surface()); |
| 6895 EXPECT_TRUE(render_surface1->render_surface()); | 6895 EXPECT_TRUE(render_surface1->render_surface()); |
| 6896 EXPECT_TRUE(render_surface2->render_surface()); | 6896 EXPECT_TRUE(render_surface2->render_surface()); |
| 6897 | 6897 |
| 6898 EXPECT_EQ(gfx::Rect(0, 0, 5, 5).ToString(), | 6898 EXPECT_EQ(gfx::Rect(0, 0, 5, 5).ToString(), |
| 6899 render_surface1->clip_rect().ToString()); | 6899 render_surface1->clip_rect().ToString()); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7034 gfx::PointF(), | 7034 gfx::PointF(), |
| 7035 gfx::Size(20, 20), | 7035 gfx::Size(20, 20), |
| 7036 true, | 7036 true, |
| 7037 false); | 7037 false); |
| 7038 | 7038 |
| 7039 root->SetShouldFlattenTransform(false); | 7039 root->SetShouldFlattenTransform(false); |
| 7040 root->Set3dSortingContextId(1); | 7040 root->Set3dSortingContextId(1); |
| 7041 render_surface->SetDoubleSided(false); | 7041 render_surface->SetDoubleSided(false); |
| 7042 render_surface->SetForceRenderSurface(true); | 7042 render_surface->SetForceRenderSurface(true); |
| 7043 | 7043 |
| 7044 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 7044 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 7045 host->SetRootLayer(root); | 7045 host->SetRootLayer(root); |
| 7046 | 7046 |
| 7047 ExecuteCalculateDrawProperties(root.get()); | 7047 ExecuteCalculateDrawProperties(root.get()); |
| 7048 | 7048 |
| 7049 EXPECT_EQ(2u, render_surface_layer_list()->size()); | 7049 EXPECT_EQ(2u, render_surface_layer_list()->size()); |
| 7050 EXPECT_EQ(1u, | 7050 EXPECT_EQ(1u, |
| 7051 render_surface_layer_list()->at(0) | 7051 render_surface_layer_list()->at(0) |
| 7052 ->render_surface()->layer_list().size()); | 7052 ->render_surface()->layer_list().size()); |
| 7053 EXPECT_EQ(1u, | 7053 EXPECT_EQ(1u, |
| 7054 render_surface_layer_list()->at(1) | 7054 render_surface_layer_list()->at(1) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7125 true, | 7125 true, |
| 7126 false); | 7126 false); |
| 7127 SetLayerPropertiesForTesting(scroll_child.get(), | 7127 SetLayerPropertiesForTesting(scroll_child.get(), |
| 7128 identity_transform, | 7128 identity_transform, |
| 7129 gfx::Point3F(), | 7129 gfx::Point3F(), |
| 7130 gfx::PointF(), | 7130 gfx::PointF(), |
| 7131 gfx::Size(50, 50), | 7131 gfx::Size(50, 50), |
| 7132 true, | 7132 true, |
| 7133 false); | 7133 false); |
| 7134 | 7134 |
| 7135 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 7135 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 7136 host->SetRootLayer(root); | 7136 host->SetRootLayer(root); |
| 7137 | 7137 |
| 7138 ExecuteCalculateDrawProperties(root.get()); | 7138 ExecuteCalculateDrawProperties(root.get()); |
| 7139 | 7139 |
| 7140 EXPECT_TRUE(root->render_surface()); | 7140 EXPECT_TRUE(root->render_surface()); |
| 7141 | 7141 |
| 7142 EXPECT_EQ(gfx::Rect(0, 0, 30, 30).ToString(), | 7142 EXPECT_EQ(gfx::Rect(0, 0, 30, 30).ToString(), |
| 7143 scroll_child->clip_rect().ToString()); | 7143 scroll_child->clip_rect().ToString()); |
| 7144 EXPECT_TRUE(scroll_child->is_clipped()); | 7144 EXPECT_TRUE(scroll_child->is_clipped()); |
| 7145 } | 7145 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 7174 parent->SetForceRenderSurface(true); | 7174 parent->SetForceRenderSurface(true); |
| 7175 SetLayerPropertiesForTesting(child.get(), | 7175 SetLayerPropertiesForTesting(child.get(), |
| 7176 identity_transform, | 7176 identity_transform, |
| 7177 gfx::Point3F(), | 7177 gfx::Point3F(), |
| 7178 gfx::PointF(), | 7178 gfx::PointF(), |
| 7179 gfx::Size(20, 20), | 7179 gfx::Size(20, 20), |
| 7180 true, | 7180 true, |
| 7181 true); | 7181 true); |
| 7182 child->SetForceRenderSurface(true); | 7182 child->SetForceRenderSurface(true); |
| 7183 | 7183 |
| 7184 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 7184 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 7185 host->SetRootLayer(root); | 7185 host->SetRootLayer(root); |
| 7186 | 7186 |
| 7187 ExecuteCalculateDrawProperties(root.get()); | 7187 ExecuteCalculateDrawProperties(root.get()); |
| 7188 | 7188 |
| 7189 EXPECT_EQ(3u, render_surface_layer_list()->size()); | 7189 EXPECT_EQ(3u, render_surface_layer_list()->size()); |
| 7190 | 7190 |
| 7191 gfx::Transform singular_transform; | 7191 gfx::Transform singular_transform; |
| 7192 singular_transform.Scale3d( | 7192 singular_transform.Scale3d( |
| 7193 SkDoubleToMScalar(1.0), SkDoubleToMScalar(1.0), SkDoubleToMScalar(0.0)); | 7193 SkDoubleToMScalar(1.0), SkDoubleToMScalar(1.0), SkDoubleToMScalar(0.0)); |
| 7194 | 7194 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7266 true, | 7266 true, |
| 7267 false); | 7267 false); |
| 7268 SetLayerPropertiesForTesting(scroll_child.get(), | 7268 SetLayerPropertiesForTesting(scroll_child.get(), |
| 7269 identity_transform, | 7269 identity_transform, |
| 7270 gfx::Point3F(), | 7270 gfx::Point3F(), |
| 7271 gfx::PointF(), | 7271 gfx::PointF(), |
| 7272 gfx::Size(50, 50), | 7272 gfx::Size(50, 50), |
| 7273 true, | 7273 true, |
| 7274 false); | 7274 false); |
| 7275 | 7275 |
| 7276 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 7276 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 7277 host->SetRootLayer(root); | 7277 host->SetRootLayer(root); |
| 7278 | 7278 |
| 7279 ExecuteCalculateDrawProperties(root.get()); | 7279 ExecuteCalculateDrawProperties(root.get()); |
| 7280 | 7280 |
| 7281 EXPECT_TRUE(root->render_surface()); | 7281 EXPECT_TRUE(root->render_surface()); |
| 7282 | 7282 |
| 7283 EXPECT_EQ(gfx::Rect(0, 0, 30, 30).ToString(), | 7283 EXPECT_EQ(gfx::Rect(0, 0, 30, 30).ToString(), |
| 7284 scroll_child->clip_rect().ToString()); | 7284 scroll_child->clip_rect().ToString()); |
| 7285 EXPECT_TRUE(scroll_child->is_clipped()); | 7285 EXPECT_TRUE(scroll_child->is_clipped()); |
| 7286 } | 7286 } |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7379 true, | 7379 true, |
| 7380 false); | 7380 false); |
| 7381 SetLayerPropertiesForTesting(scroll_child.get(), | 7381 SetLayerPropertiesForTesting(scroll_child.get(), |
| 7382 identity_transform, | 7382 identity_transform, |
| 7383 gfx::Point3F(), | 7383 gfx::Point3F(), |
| 7384 gfx::PointF(), | 7384 gfx::PointF(), |
| 7385 gfx::Size(50, 50), | 7385 gfx::Size(50, 50), |
| 7386 true, | 7386 true, |
| 7387 false); | 7387 false); |
| 7388 | 7388 |
| 7389 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 7389 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 7390 host->SetRootLayer(root); | 7390 host->SetRootLayer(root); |
| 7391 | 7391 |
| 7392 ExecuteCalculateDrawProperties(root.get()); | 7392 ExecuteCalculateDrawProperties(root.get()); |
| 7393 | 7393 |
| 7394 EXPECT_TRUE(root->render_surface()); | 7394 EXPECT_TRUE(root->render_surface()); |
| 7395 | 7395 |
| 7396 EXPECT_EQ(gfx::Rect(0, 0, 20, 20).ToString(), | 7396 EXPECT_EQ(gfx::Rect(0, 0, 20, 20).ToString(), |
| 7397 scroll_child->clip_rect().ToString()); | 7397 scroll_child->clip_rect().ToString()); |
| 7398 EXPECT_TRUE(scroll_child->is_clipped()); | 7398 EXPECT_TRUE(scroll_child->is_clipped()); |
| 7399 | 7399 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7528 true, | 7528 true, |
| 7529 false); | 7529 false); |
| 7530 SetLayerPropertiesForTesting(scroll_child.get(), | 7530 SetLayerPropertiesForTesting(scroll_child.get(), |
| 7531 identity_transform, | 7531 identity_transform, |
| 7532 gfx::Point3F(), | 7532 gfx::Point3F(), |
| 7533 gfx::PointF(), | 7533 gfx::PointF(), |
| 7534 gfx::Size(50, 50), | 7534 gfx::Size(50, 50), |
| 7535 true, | 7535 true, |
| 7536 false); | 7536 false); |
| 7537 | 7537 |
| 7538 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(); | 7538 scoped_ptr<FakeLayerTreeHost> host(CreateFakeLayerTreeHost()); |
| 7539 host->SetRootLayer(root); | 7539 host->SetRootLayer(root); |
| 7540 | 7540 |
| 7541 RenderSurfaceLayerList render_surface_layer_list; | 7541 RenderSurfaceLayerList render_surface_layer_list; |
| 7542 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 7542 LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 7543 root.get(), | 7543 root.get(), |
| 7544 root->bounds(), | 7544 root->bounds(), |
| 7545 identity_transform, | 7545 identity_transform, |
| 7546 &render_surface_layer_list); | 7546 &render_surface_layer_list); |
| 7547 | 7547 |
| 7548 LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 7548 LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| (...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8593 EXPECT_FLOAT_EQ(4.f, | 8593 EXPECT_FLOAT_EQ(4.f, |
| 8594 child1_layer->replica_layer() | 8594 child1_layer->replica_layer() |
| 8595 ->mask_layer() | 8595 ->mask_layer() |
| 8596 ->draw_properties() | 8596 ->draw_properties() |
| 8597 .device_scale_factor); | 8597 .device_scale_factor); |
| 8598 EXPECT_FLOAT_EQ(4.f, child2_layer->draw_properties().device_scale_factor); | 8598 EXPECT_FLOAT_EQ(4.f, child2_layer->draw_properties().device_scale_factor); |
| 8599 } | 8599 } |
| 8600 | 8600 |
| 8601 } // namespace | 8601 } // namespace |
| 8602 } // namespace cc | 8602 } // namespace cc |
| OLD | NEW |