| 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 "cc/animation/layer_animation_controller.h" | 7 #include "cc/animation/layer_animation_controller.h" |
| 8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
| 9 #include "cc/base/thread.h" | 9 #include "cc/base/thread.h" |
| 10 #include "cc/layers/content_layer.h" | 10 #include "cc/layers/content_layer.h" |
| 11 #include "cc/layers/content_layer_client.h" | 11 #include "cc/layers/content_layer_client.h" |
| 12 #include "cc/layers/heads_up_display_layer_impl.h" | 12 #include "cc/layers/heads_up_display_layer_impl.h" |
| 13 #include "cc/layers/layer.h" | 13 #include "cc/layers/layer.h" |
| 14 #include "cc/layers/layer_impl.h" | 14 #include "cc/layers/layer_impl.h" |
| 15 #include "cc/layers/render_surface.h" |
| 16 #include "cc/layers/render_surface_impl.h" |
| 15 #include "cc/test/animation_test_common.h" | 17 #include "cc/test/animation_test_common.h" |
| 16 #include "cc/test/fake_impl_proxy.h" | 18 #include "cc/test/fake_impl_proxy.h" |
| 17 #include "cc/test/fake_layer_tree_host_impl.h" | 19 #include "cc/test/fake_layer_tree_host_impl.h" |
| 18 #include "cc/test/geometry_test_utils.h" | 20 #include "cc/test/geometry_test_utils.h" |
| 19 #include "cc/trees/layer_tree_impl.h" | 21 #include "cc/trees/layer_tree_impl.h" |
| 20 #include "cc/trees/proxy.h" | 22 #include "cc/trees/proxy.h" |
| 21 #include "cc/trees/single_thread_proxy.h" | 23 #include "cc/trees/single_thread_proxy.h" |
| 22 #include "testing/gmock/include/gmock/gmock.h" | 24 #include "testing/gmock/include/gmock/gmock.h" |
| 23 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 24 #include "ui/gfx/quad_f.h" | 26 #include "ui/gfx/quad_f.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 bounds, | 79 bounds, |
| 78 preserves3d); | 80 preserves3d); |
| 79 layer->SetContentBounds(bounds); | 81 layer->SetContentBounds(bounds); |
| 80 } | 82 } |
| 81 | 83 |
| 82 void ExecuteCalculateDrawProperties(Layer* root_layer, | 84 void ExecuteCalculateDrawProperties(Layer* root_layer, |
| 83 float device_scale_factor, | 85 float device_scale_factor, |
| 84 float page_scale_factor, | 86 float page_scale_factor, |
| 85 bool can_use_lcd_text) { | 87 bool can_use_lcd_text) { |
| 86 gfx::Transform identity_matrix; | 88 gfx::Transform identity_matrix; |
| 87 std::vector<scoped_refptr<Layer> > dummy_render_surface_layer_list; | 89 LayerList dummy_render_surface_layer_list; |
| 88 int dummy_max_texture_size = 512; | 90 int dummy_max_texture_size = 512; |
| 89 gfx::Size device_viewport_size = | 91 gfx::Size device_viewport_size = |
| 90 gfx::Size(root_layer->bounds().width() * device_scale_factor, | 92 gfx::Size(root_layer->bounds().width() * device_scale_factor, |
| 91 root_layer->bounds().height() * device_scale_factor); | 93 root_layer->bounds().height() * device_scale_factor); |
| 92 | 94 |
| 93 // We are probably not testing what is intended if the root_layer bounds are | 95 // We are probably not testing what is intended if the root_layer bounds are |
| 94 // empty. | 96 // empty. |
| 95 DCHECK(!root_layer->bounds().IsEmpty()); | 97 DCHECK(!root_layer->bounds().IsEmpty()); |
| 96 LayerTreeHostCommon::CalculateDrawProperties( | 98 LayerTreeHostCommon::CalculateDrawProperties( |
| 97 root_layer, | 99 root_layer, |
| 98 device_viewport_size, | 100 device_viewport_size, |
| 99 device_scale_factor, | 101 device_scale_factor, |
| 100 page_scale_factor, | 102 page_scale_factor, |
| 101 dummy_max_texture_size, | 103 dummy_max_texture_size, |
| 102 can_use_lcd_text, | 104 can_use_lcd_text, |
| 103 &dummy_render_surface_layer_list); | 105 &dummy_render_surface_layer_list); |
| 104 } | 106 } |
| 105 | 107 |
| 106 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, | 108 void ExecuteCalculateDrawProperties(LayerImpl* root_layer, |
| 107 float device_scale_factor, | 109 float device_scale_factor, |
| 108 float page_scale_factor, | 110 float page_scale_factor, |
| 109 bool can_use_lcd_text) { | 111 bool can_use_lcd_text) { |
| 110 gfx::Transform identity_matrix; | 112 gfx::Transform identity_matrix; |
| 111 std::vector<LayerImpl*> dummy_render_surface_layer_list; | 113 LayerImplList dummy_render_surface_layer_list; |
| 112 int dummy_max_texture_size = 512; | 114 int dummy_max_texture_size = 512; |
| 113 gfx::Size device_viewport_size = | 115 gfx::Size device_viewport_size = |
| 114 gfx::Size(root_layer->bounds().width() * device_scale_factor, | 116 gfx::Size(root_layer->bounds().width() * device_scale_factor, |
| 115 root_layer->bounds().height() * device_scale_factor); | 117 root_layer->bounds().height() * device_scale_factor); |
| 116 | 118 |
| 117 // We are probably not testing what is intended if the root_layer bounds are | 119 // We are probably not testing what is intended if the root_layer bounds are |
| 118 // empty. | 120 // empty. |
| 119 DCHECK(!root_layer->bounds().IsEmpty()); | 121 DCHECK(!root_layer->bounds().IsEmpty()); |
| 120 LayerTreeHostCommon::CalculateDrawProperties(root_layer, | 122 LayerTreeHostCommon::CalculateDrawProperties(root_layer, |
| 121 device_viewport_size, | 123 device_viewport_size, |
| (...skipping 1420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 gfx::PointF(), | 1544 gfx::PointF(), |
| 1543 gfx::PointF(30.f, 30.f), | 1545 gfx::PointF(30.f, 30.f), |
| 1544 gfx::Size(10, 10), | 1546 gfx::Size(10, 10), |
| 1545 false); | 1547 false); |
| 1546 | 1548 |
| 1547 parent->AddChild(render_surface1); | 1549 parent->AddChild(render_surface1); |
| 1548 parent->SetMasksToBounds(true); | 1550 parent->SetMasksToBounds(true); |
| 1549 render_surface1->AddChild(child); | 1551 render_surface1->AddChild(child); |
| 1550 render_surface1->SetForceRenderSurface(true); | 1552 render_surface1->SetForceRenderSurface(true); |
| 1551 | 1553 |
| 1552 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 1554 LayerList render_surface_layer_list; |
| 1553 int dummy_max_texture_size = 512; | 1555 int dummy_max_texture_size = 512; |
| 1554 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 1556 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 1555 parent->bounds(), | 1557 parent->bounds(), |
| 1556 1.f, | 1558 1.f, |
| 1557 1.f, | 1559 1.f, |
| 1558 dummy_max_texture_size, | 1560 dummy_max_texture_size, |
| 1559 false, | 1561 false, |
| 1560 &render_surface_layer_list); | 1562 &render_surface_layer_list); |
| 1561 | 1563 |
| 1562 // The child layer's content is entirely outside the parent's clip rect, so | 1564 // The child layer's content is entirely outside the parent's clip rect, so |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1589 gfx::PointF(), | 1591 gfx::PointF(), |
| 1590 gfx::PointF(), | 1592 gfx::PointF(), |
| 1591 gfx::Size(10, 10), | 1593 gfx::Size(10, 10), |
| 1592 false); | 1594 false); |
| 1593 | 1595 |
| 1594 parent->AddChild(render_surface1); | 1596 parent->AddChild(render_surface1); |
| 1595 render_surface1->AddChild(child); | 1597 render_surface1->AddChild(child); |
| 1596 render_surface1->SetForceRenderSurface(true); | 1598 render_surface1->SetForceRenderSurface(true); |
| 1597 render_surface1->SetOpacity(0.f); | 1599 render_surface1->SetOpacity(0.f); |
| 1598 | 1600 |
| 1599 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 1601 LayerList render_surface_layer_list; |
| 1600 int dummy_max_texture_size = 512; | 1602 int dummy_max_texture_size = 512; |
| 1601 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 1603 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 1602 parent->bounds(), | 1604 parent->bounds(), |
| 1603 1.f, | 1605 1.f, |
| 1604 1.f, | 1606 1.f, |
| 1605 dummy_max_texture_size, | 1607 dummy_max_texture_size, |
| 1606 false, | 1608 false, |
| 1607 &render_surface_layer_list); | 1609 &render_surface_layer_list); |
| 1608 | 1610 |
| 1609 // Since the layer is transparent, render_surface1->render_surface() should | 1611 // Since the layer is transparent, render_surface1->render_surface() should |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 gfx::Size(10, 10), | 1648 gfx::Size(10, 10), |
| 1647 false); | 1649 false); |
| 1648 | 1650 |
| 1649 parent->AddChild(render_surface1); | 1651 parent->AddChild(render_surface1); |
| 1650 render_surface1->AddChild(child); | 1652 render_surface1->AddChild(child); |
| 1651 | 1653 |
| 1652 // Sanity check before the actual test | 1654 // Sanity check before the actual test |
| 1653 EXPECT_FALSE(parent->render_surface()); | 1655 EXPECT_FALSE(parent->render_surface()); |
| 1654 EXPECT_FALSE(render_surface1->render_surface()); | 1656 EXPECT_FALSE(render_surface1->render_surface()); |
| 1655 | 1657 |
| 1656 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 1658 LayerList render_surface_layer_list; |
| 1657 int dummy_max_texture_size = 512; | 1659 int dummy_max_texture_size = 512; |
| 1658 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 1660 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 1659 parent->bounds(), | 1661 parent->bounds(), |
| 1660 1.f, | 1662 1.f, |
| 1661 1.f, | 1663 1.f, |
| 1662 dummy_max_texture_size, | 1664 dummy_max_texture_size, |
| 1663 false, | 1665 false, |
| 1664 &render_surface_layer_list); | 1666 &render_surface_layer_list); |
| 1665 | 1667 |
| 1666 // The root layer always creates a render surface | 1668 // The root layer always creates a render surface |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2453 gfx::PointF(), | 2455 gfx::PointF(), |
| 2454 gfx::Size(20, 20), | 2456 gfx::Size(20, 20), |
| 2455 false); | 2457 false); |
| 2456 | 2458 |
| 2457 child->SetMasksToBounds(true); | 2459 child->SetMasksToBounds(true); |
| 2458 child->SetOpacity(0.4f); | 2460 child->SetOpacity(0.4f); |
| 2459 child->SetForceRenderSurface(true); | 2461 child->SetForceRenderSurface(true); |
| 2460 grand_child->SetOpacity(0.5f); | 2462 grand_child->SetOpacity(0.5f); |
| 2461 great_grand_child->SetOpacity(0.4f); | 2463 great_grand_child->SetOpacity(0.4f); |
| 2462 | 2464 |
| 2463 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 2465 LayerList render_surface_layer_list; |
| 2464 int dummy_max_texture_size = 512; | 2466 int dummy_max_texture_size = 512; |
| 2465 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 2467 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 2466 parent->bounds(), | 2468 parent->bounds(), |
| 2467 1.f, | 2469 1.f, |
| 2468 1.f, | 2470 1.f, |
| 2469 dummy_max_texture_size, | 2471 dummy_max_texture_size, |
| 2470 false, | 2472 false, |
| 2471 &render_surface_layer_list); | 2473 &render_surface_layer_list); |
| 2472 | 2474 |
| 2473 ASSERT_EQ(2U, render_surface_layer_list.size()); | 2475 ASSERT_EQ(2U, render_surface_layer_list.size()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2532 gfx::PointF(), | 2534 gfx::PointF(), |
| 2533 gfx::Size(10, 10), | 2535 gfx::Size(10, 10), |
| 2534 false); | 2536 false); |
| 2535 | 2537 |
| 2536 parent->SetMasksToBounds(true); | 2538 parent->SetMasksToBounds(true); |
| 2537 child->SetOpacity(0.4f); | 2539 child->SetOpacity(0.4f); |
| 2538 child->SetForceRenderSurface(true); | 2540 child->SetForceRenderSurface(true); |
| 2539 grand_child->SetOpacity(0.4f); | 2541 grand_child->SetOpacity(0.4f); |
| 2540 grand_child->SetForceRenderSurface(true); | 2542 grand_child->SetForceRenderSurface(true); |
| 2541 | 2543 |
| 2542 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 2544 LayerList render_surface_layer_list; |
| 2543 int dummy_max_texture_size = 512; | 2545 int dummy_max_texture_size = 512; |
| 2544 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 2546 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 2545 parent->bounds(), | 2547 parent->bounds(), |
| 2546 1.f, | 2548 1.f, |
| 2547 1.f, | 2549 1.f, |
| 2548 dummy_max_texture_size, | 2550 dummy_max_texture_size, |
| 2549 false, | 2551 false, |
| 2550 &render_surface_layer_list); | 2552 &render_surface_layer_list); |
| 2551 | 2553 |
| 2552 // Without an animation, we should cull child and grand_child from the | 2554 // Without an animation, we should cull child and grand_child from the |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2656 false); | 2658 false); |
| 2657 SetLayerPropertiesForTesting(leaf_node2.get(), | 2659 SetLayerPropertiesForTesting(leaf_node2.get(), |
| 2658 identity_matrix, | 2660 identity_matrix, |
| 2659 identity_matrix, | 2661 identity_matrix, |
| 2660 gfx::PointF(), | 2662 gfx::PointF(), |
| 2661 gfx::PointF(), | 2663 gfx::PointF(), |
| 2662 gfx::Size(100, 100), | 2664 gfx::Size(100, 100), |
| 2663 false); | 2665 false); |
| 2664 | 2666 |
| 2665 // Case 1: nothing is clipped except the root render surface. | 2667 // Case 1: nothing is clipped except the root render surface. |
| 2666 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 2668 LayerList render_surface_layer_list; |
| 2667 int dummy_max_texture_size = 512; | 2669 int dummy_max_texture_size = 512; |
| 2668 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 2670 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 2669 parent->bounds(), | 2671 parent->bounds(), |
| 2670 1.f, | 2672 1.f, |
| 2671 1.f, | 2673 1.f, |
| 2672 dummy_max_texture_size, | 2674 dummy_max_texture_size, |
| 2673 false, | 2675 false, |
| 2674 &render_surface_layer_list); | 2676 &render_surface_layer_list); |
| 2675 | 2677 |
| 2676 ASSERT_TRUE(root->render_surface()); | 2678 ASSERT_TRUE(root->render_surface()); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2815 child->SetMasksToBounds(true); | 2817 child->SetMasksToBounds(true); |
| 2816 grand_child3->SetMasksToBounds(true); | 2818 grand_child3->SetMasksToBounds(true); |
| 2817 | 2819 |
| 2818 // Force everyone to be a render surface. | 2820 // Force everyone to be a render surface. |
| 2819 child->SetOpacity(0.4f); | 2821 child->SetOpacity(0.4f); |
| 2820 grand_child1->SetOpacity(0.5f); | 2822 grand_child1->SetOpacity(0.5f); |
| 2821 grand_child2->SetOpacity(0.5f); | 2823 grand_child2->SetOpacity(0.5f); |
| 2822 grand_child3->SetOpacity(0.5f); | 2824 grand_child3->SetOpacity(0.5f); |
| 2823 grand_child4->SetOpacity(0.5f); | 2825 grand_child4->SetOpacity(0.5f); |
| 2824 | 2826 |
| 2825 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 2827 LayerList render_surface_layer_list; |
| 2826 int dummy_max_texture_size = 512; | 2828 int dummy_max_texture_size = 512; |
| 2827 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 2829 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 2828 parent->bounds(), | 2830 parent->bounds(), |
| 2829 1.f, | 2831 1.f, |
| 2830 1.f, | 2832 1.f, |
| 2831 dummy_max_texture_size, | 2833 dummy_max_texture_size, |
| 2832 false, | 2834 false, |
| 2833 &render_surface_layer_list); | 2835 &render_surface_layer_list); |
| 2834 | 2836 |
| 2835 EXPECT_RECT_EQ(gfx::Rect(5, 5, 10, 10), | 2837 EXPECT_RECT_EQ(gfx::Rect(5, 5, 10, 10), |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2958 child->SetForceRenderSurface(true); | 2960 child->SetForceRenderSurface(true); |
| 2959 grand_child1->SetOpacity(0.5f); | 2961 grand_child1->SetOpacity(0.5f); |
| 2960 grand_child1->SetForceRenderSurface(true); | 2962 grand_child1->SetForceRenderSurface(true); |
| 2961 grand_child2->SetOpacity(0.5f); | 2963 grand_child2->SetOpacity(0.5f); |
| 2962 grand_child2->SetForceRenderSurface(true); | 2964 grand_child2->SetForceRenderSurface(true); |
| 2963 grand_child3->SetOpacity(0.5f); | 2965 grand_child3->SetOpacity(0.5f); |
| 2964 grand_child3->SetForceRenderSurface(true); | 2966 grand_child3->SetForceRenderSurface(true); |
| 2965 grand_child4->SetOpacity(0.5f); | 2967 grand_child4->SetOpacity(0.5f); |
| 2966 grand_child4->SetForceRenderSurface(true); | 2968 grand_child4->SetForceRenderSurface(true); |
| 2967 | 2969 |
| 2968 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 2970 LayerList render_surface_layer_list; |
| 2969 int dummy_max_texture_size = 512; | 2971 int dummy_max_texture_size = 512; |
| 2970 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 2972 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 2971 parent->bounds(), | 2973 parent->bounds(), |
| 2972 1.f, | 2974 1.f, |
| 2973 1.f, | 2975 1.f, |
| 2974 dummy_max_texture_size, | 2976 dummy_max_texture_size, |
| 2975 false, | 2977 false, |
| 2976 &render_surface_layer_list); | 2978 &render_surface_layer_list); |
| 2977 | 2979 |
| 2978 ASSERT_TRUE(grand_child1->render_surface()); | 2980 ASSERT_TRUE(grand_child1->render_surface()); |
| (...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4255 gfx::Size(100, 100), | 4257 gfx::Size(100, 100), |
| 4256 false); | 4258 false); |
| 4257 SetLayerPropertiesForTesting(back_facing_child_of_back_facing_surface.get(), | 4259 SetLayerPropertiesForTesting(back_facing_child_of_back_facing_surface.get(), |
| 4258 backface_matrix, | 4260 backface_matrix, |
| 4259 identity_matrix, | 4261 identity_matrix, |
| 4260 gfx::PointF(), | 4262 gfx::PointF(), |
| 4261 gfx::PointF(), | 4263 gfx::PointF(), |
| 4262 gfx::Size(100, 100), | 4264 gfx::Size(100, 100), |
| 4263 false); | 4265 false); |
| 4264 | 4266 |
| 4265 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 4267 LayerList render_surface_layer_list; |
| 4266 int dummy_max_texture_size = 512; | 4268 int dummy_max_texture_size = 512; |
| 4267 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 4269 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 4268 parent->bounds(), | 4270 parent->bounds(), |
| 4269 1.f, | 4271 1.f, |
| 4270 1.f, | 4272 1.f, |
| 4271 dummy_max_texture_size, | 4273 dummy_max_texture_size, |
| 4272 false, | 4274 false, |
| 4273 &render_surface_layer_list); | 4275 &render_surface_layer_list); |
| 4274 | 4276 |
| 4275 // Verify which render surfaces were created. | 4277 // Verify which render surfaces were created. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4447 gfx::Size(100, 100), | 4449 gfx::Size(100, 100), |
| 4448 false); | 4450 false); |
| 4449 SetLayerPropertiesForTesting(back_facing_child_of_back_facing_surface.get(), | 4451 SetLayerPropertiesForTesting(back_facing_child_of_back_facing_surface.get(), |
| 4450 backface_matrix, | 4452 backface_matrix, |
| 4451 identity_matrix, | 4453 identity_matrix, |
| 4452 gfx::PointF(), | 4454 gfx::PointF(), |
| 4453 gfx::PointF(), | 4455 gfx::PointF(), |
| 4454 gfx::Size(100, 100), | 4456 gfx::Size(100, 100), |
| 4455 false); | 4457 false); |
| 4456 | 4458 |
| 4457 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 4459 LayerList render_surface_layer_list; |
| 4458 int dummy_max_texture_size = 512; | 4460 int dummy_max_texture_size = 512; |
| 4459 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 4461 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 4460 parent->bounds(), | 4462 parent->bounds(), |
| 4461 1.f, | 4463 1.f, |
| 4462 1.f, | 4464 1.f, |
| 4463 dummy_max_texture_size, | 4465 dummy_max_texture_size, |
| 4464 false, | 4466 false, |
| 4465 &render_surface_layer_list); | 4467 &render_surface_layer_list); |
| 4466 | 4468 |
| 4467 // Verify which render surfaces were created. | 4469 // Verify which render surfaces were created. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4585 gfx::Size(100, 100), | 4587 gfx::Size(100, 100), |
| 4586 false); | 4588 false); |
| 4587 SetLayerPropertiesForTesting(child2.get(), | 4589 SetLayerPropertiesForTesting(child2.get(), |
| 4588 identity_matrix, | 4590 identity_matrix, |
| 4589 identity_matrix, | 4591 identity_matrix, |
| 4590 gfx::PointF(), | 4592 gfx::PointF(), |
| 4591 gfx::PointF(), | 4593 gfx::PointF(), |
| 4592 gfx::Size(100, 100), | 4594 gfx::Size(100, 100), |
| 4593 false); | 4595 false); |
| 4594 | 4596 |
| 4595 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 4597 LayerList render_surface_layer_list; |
| 4596 int dummy_max_texture_size = 512; | 4598 int dummy_max_texture_size = 512; |
| 4597 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 4599 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 4598 parent->bounds(), | 4600 parent->bounds(), |
| 4599 1.f, | 4601 1.f, |
| 4600 1.f, | 4602 1.f, |
| 4601 dummy_max_texture_size, | 4603 dummy_max_texture_size, |
| 4602 false, | 4604 false, |
| 4603 &render_surface_layer_list); | 4605 &render_surface_layer_list); |
| 4604 | 4606 |
| 4605 EXPECT_FALSE(child->render_surface()); | 4607 EXPECT_FALSE(child->render_surface()); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4711 gfx::Size(100, 100), | 4713 gfx::Size(100, 100), |
| 4712 false); | 4714 false); |
| 4713 SetLayerPropertiesForTesting(child2.get(), | 4715 SetLayerPropertiesForTesting(child2.get(), |
| 4714 identity_matrix, | 4716 identity_matrix, |
| 4715 identity_matrix, | 4717 identity_matrix, |
| 4716 gfx::PointF(), | 4718 gfx::PointF(), |
| 4717 gfx::PointF(), | 4719 gfx::PointF(), |
| 4718 gfx::Size(100, 100), | 4720 gfx::Size(100, 100), |
| 4719 false); | 4721 false); |
| 4720 | 4722 |
| 4721 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 4723 LayerList render_surface_layer_list; |
| 4722 int dummy_max_texture_size = 512; | 4724 int dummy_max_texture_size = 512; |
| 4723 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 4725 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 4724 parent->bounds(), | 4726 parent->bounds(), |
| 4725 1.f, | 4727 1.f, |
| 4726 1.f, | 4728 1.f, |
| 4727 dummy_max_texture_size, | 4729 dummy_max_texture_size, |
| 4728 false, | 4730 false, |
| 4729 &render_surface_layer_list); | 4731 &render_surface_layer_list); |
| 4730 | 4732 |
| 4731 // Verify which render surfaces were created. | 4733 // Verify which render surfaces were created. |
| (...skipping 23 matching lines...) Expand all Loading... |
| 4755 front_facing_surface->id(), | 4757 front_facing_surface->id(), |
| 4756 render_surface_layer_list[1]->render_surface()->layer_list()[0]->id()); | 4758 render_surface_layer_list[1]->render_surface()->layer_list()[0]->id()); |
| 4757 EXPECT_EQ( | 4759 EXPECT_EQ( |
| 4758 child1->id(), | 4760 child1->id(), |
| 4759 render_surface_layer_list[1]->render_surface()->layer_list()[1]->id()); | 4761 render_surface_layer_list[1]->render_surface()->layer_list()[1]->id()); |
| 4760 } | 4762 } |
| 4761 | 4763 |
| 4762 TEST(LayerTreeHostCommonTest, HitTestingForEmptyLayerList) { | 4764 TEST(LayerTreeHostCommonTest, HitTestingForEmptyLayerList) { |
| 4763 // Hit testing on an empty render_surface_layer_list should return a null | 4765 // Hit testing on an empty render_surface_layer_list should return a null |
| 4764 // pointer. | 4766 // pointer. |
| 4765 std::vector<LayerImpl*> render_surface_layer_list; | 4767 LayerImplList render_surface_layer_list; |
| 4766 | 4768 |
| 4767 gfx::Point test_point(0, 0); | 4769 gfx::Point test_point(0, 0); |
| 4768 LayerImpl* result_layer = LayerTreeHostCommon::FindLayerThatIsHitByPoint( | 4770 LayerImpl* result_layer = LayerTreeHostCommon::FindLayerThatIsHitByPoint( |
| 4769 test_point, render_surface_layer_list); | 4771 test_point, render_surface_layer_list); |
| 4770 EXPECT_FALSE(result_layer); | 4772 EXPECT_FALSE(result_layer); |
| 4771 | 4773 |
| 4772 test_point = gfx::Point(10, 20); | 4774 test_point = gfx::Point(10, 20); |
| 4773 result_layer = LayerTreeHostCommon::FindLayerThatIsHitByPoint( | 4775 result_layer = LayerTreeHostCommon::FindLayerThatIsHitByPoint( |
| 4774 test_point, render_surface_layer_list); | 4776 test_point, render_surface_layer_list); |
| 4775 EXPECT_FALSE(result_layer); | 4777 EXPECT_FALSE(result_layer); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 4787 gfx::Size bounds(100, 100); | 4789 gfx::Size bounds(100, 100); |
| 4788 SetLayerPropertiesForTesting(root.get(), | 4790 SetLayerPropertiesForTesting(root.get(), |
| 4789 identity_matrix, | 4791 identity_matrix, |
| 4790 identity_matrix, | 4792 identity_matrix, |
| 4791 anchor, | 4793 anchor, |
| 4792 position, | 4794 position, |
| 4793 bounds, | 4795 bounds, |
| 4794 false); | 4796 false); |
| 4795 root->SetDrawsContent(true); | 4797 root->SetDrawsContent(true); |
| 4796 | 4798 |
| 4797 std::vector<LayerImpl*> render_surface_layer_list; | 4799 LayerImplList render_surface_layer_list; |
| 4798 int dummy_max_texture_size = 512; | 4800 int dummy_max_texture_size = 512; |
| 4799 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 4801 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 4800 root->bounds(), | 4802 root->bounds(), |
| 4801 1.f, | 4803 1.f, |
| 4802 1.f, | 4804 1.f, |
| 4803 dummy_max_texture_size, | 4805 dummy_max_texture_size, |
| 4804 false, | 4806 false, |
| 4805 &render_surface_layer_list, | 4807 &render_surface_layer_list, |
| 4806 false); | 4808 false); |
| 4807 | 4809 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4862 identity_matrix, | 4864 identity_matrix, |
| 4863 anchor, | 4865 anchor, |
| 4864 position, | 4866 position, |
| 4865 hud_bounds, | 4867 hud_bounds, |
| 4866 false); | 4868 false); |
| 4867 hud->SetDrawsContent(true); | 4869 hud->SetDrawsContent(true); |
| 4868 | 4870 |
| 4869 host_impl.active_tree()->set_hud_layer(hud.get()); | 4871 host_impl.active_tree()->set_hud_layer(hud.get()); |
| 4870 root->AddChild(hud.PassAs<LayerImpl>()); | 4872 root->AddChild(hud.PassAs<LayerImpl>()); |
| 4871 | 4873 |
| 4872 std::vector<LayerImpl*> render_surface_layer_list; | 4874 LayerImplList render_surface_layer_list; |
| 4873 int dummy_max_texture_size = 512; | 4875 int dummy_max_texture_size = 512; |
| 4874 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 4876 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 4875 hud_bounds, | 4877 hud_bounds, |
| 4876 1.f, | 4878 1.f, |
| 4877 1.f, | 4879 1.f, |
| 4878 dummy_max_texture_size, | 4880 dummy_max_texture_size, |
| 4879 false, | 4881 false, |
| 4880 &render_surface_layer_list, | 4882 &render_surface_layer_list, |
| 4881 false); | 4883 false); |
| 4882 | 4884 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4929 gfx::Size bounds(100, 100); | 4931 gfx::Size bounds(100, 100); |
| 4930 SetLayerPropertiesForTesting(root.get(), | 4932 SetLayerPropertiesForTesting(root.get(), |
| 4931 uninvertible_transform, | 4933 uninvertible_transform, |
| 4932 identity_matrix, | 4934 identity_matrix, |
| 4933 anchor, | 4935 anchor, |
| 4934 position, | 4936 position, |
| 4935 bounds, | 4937 bounds, |
| 4936 false); | 4938 false); |
| 4937 root->SetDrawsContent(true); | 4939 root->SetDrawsContent(true); |
| 4938 | 4940 |
| 4939 std::vector<LayerImpl*> render_surface_layer_list; | 4941 LayerImplList render_surface_layer_list; |
| 4940 int dummy_max_texture_size = 512; | 4942 int dummy_max_texture_size = 512; |
| 4941 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 4943 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 4942 root->bounds(), | 4944 root->bounds(), |
| 4943 1.f, | 4945 1.f, |
| 4944 1.f, | 4946 1.f, |
| 4945 dummy_max_texture_size, | 4947 dummy_max_texture_size, |
| 4946 false, | 4948 false, |
| 4947 &render_surface_layer_list, | 4949 &render_surface_layer_list, |
| 4948 false); | 4950 false); |
| 4949 | 4951 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5005 gfx::Size bounds(100, 100); | 5007 gfx::Size bounds(100, 100); |
| 5006 SetLayerPropertiesForTesting(root.get(), | 5008 SetLayerPropertiesForTesting(root.get(), |
| 5007 identity_matrix, | 5009 identity_matrix, |
| 5008 identity_matrix, | 5010 identity_matrix, |
| 5009 anchor, | 5011 anchor, |
| 5010 position, | 5012 position, |
| 5011 bounds, | 5013 bounds, |
| 5012 false); | 5014 false); |
| 5013 root->SetDrawsContent(true); | 5015 root->SetDrawsContent(true); |
| 5014 | 5016 |
| 5015 std::vector<LayerImpl*> render_surface_layer_list; | 5017 LayerImplList render_surface_layer_list; |
| 5016 int dummy_max_texture_size = 512; | 5018 int dummy_max_texture_size = 512; |
| 5017 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5019 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5018 root->bounds(), | 5020 root->bounds(), |
| 5019 1.f, | 5021 1.f, |
| 5020 1.f, | 5022 1.f, |
| 5021 dummy_max_texture_size, | 5023 dummy_max_texture_size, |
| 5022 false, | 5024 false, |
| 5023 &render_surface_layer_list, | 5025 &render_surface_layer_list, |
| 5024 false); | 5026 false); |
| 5025 | 5027 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5070 gfx::Size bounds(100, 100); | 5072 gfx::Size bounds(100, 100); |
| 5071 SetLayerPropertiesForTesting(root.get(), | 5073 SetLayerPropertiesForTesting(root.get(), |
| 5072 rotation45_degrees_about_center, | 5074 rotation45_degrees_about_center, |
| 5073 identity_matrix, | 5075 identity_matrix, |
| 5074 anchor, | 5076 anchor, |
| 5075 position, | 5077 position, |
| 5076 bounds, | 5078 bounds, |
| 5077 false); | 5079 false); |
| 5078 root->SetDrawsContent(true); | 5080 root->SetDrawsContent(true); |
| 5079 | 5081 |
| 5080 std::vector<LayerImpl*> render_surface_layer_list; | 5082 LayerImplList render_surface_layer_list; |
| 5081 int dummy_max_texture_size = 512; | 5083 int dummy_max_texture_size = 512; |
| 5082 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5084 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5083 root->bounds(), | 5085 root->bounds(), |
| 5084 1.f, | 5086 1.f, |
| 5085 1.f, | 5087 1.f, |
| 5086 dummy_max_texture_size, | 5088 dummy_max_texture_size, |
| 5087 false, | 5089 false, |
| 5088 &render_surface_layer_list, | 5090 &render_surface_layer_list, |
| 5089 false); | 5091 false); |
| 5090 | 5092 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5148 SetLayerPropertiesForTesting( | 5150 SetLayerPropertiesForTesting( |
| 5149 root.get(), | 5151 root.get(), |
| 5150 perspective_projection_about_center * translation_by_z, | 5152 perspective_projection_about_center * translation_by_z, |
| 5151 identity_matrix, | 5153 identity_matrix, |
| 5152 anchor, | 5154 anchor, |
| 5153 position, | 5155 position, |
| 5154 bounds, | 5156 bounds, |
| 5155 false); | 5157 false); |
| 5156 root->SetDrawsContent(true); | 5158 root->SetDrawsContent(true); |
| 5157 | 5159 |
| 5158 std::vector<LayerImpl*> render_surface_layer_list; | 5160 LayerImplList render_surface_layer_list; |
| 5159 int dummy_max_texture_size = 512; | 5161 int dummy_max_texture_size = 512; |
| 5160 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5162 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5161 root->bounds(), | 5163 root->bounds(), |
| 5162 1.f, | 5164 1.f, |
| 5163 1.f, | 5165 1.f, |
| 5164 dummy_max_texture_size, | 5166 dummy_max_texture_size, |
| 5165 false, | 5167 false, |
| 5166 &render_surface_layer_list, | 5168 &render_surface_layer_list, |
| 5167 false); | 5169 false); |
| 5168 | 5170 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5237 false); | 5239 false); |
| 5238 | 5240 |
| 5239 // override content bounds and contents scale | 5241 // override content bounds and contents scale |
| 5240 test_layer->SetContentBounds(gfx::Size(100, 100)); | 5242 test_layer->SetContentBounds(gfx::Size(100, 100)); |
| 5241 test_layer->SetContentsScale(2, 2); | 5243 test_layer->SetContentsScale(2, 2); |
| 5242 | 5244 |
| 5243 test_layer->SetDrawsContent(true); | 5245 test_layer->SetDrawsContent(true); |
| 5244 root->AddChild(test_layer.Pass()); | 5246 root->AddChild(test_layer.Pass()); |
| 5245 } | 5247 } |
| 5246 | 5248 |
| 5247 std::vector<LayerImpl*> render_surface_layer_list; | 5249 LayerImplList render_surface_layer_list; |
| 5248 int dummy_max_texture_size = 512; | 5250 int dummy_max_texture_size = 512; |
| 5249 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5251 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5250 root->bounds(), | 5252 root->bounds(), |
| 5251 1.f, | 5253 1.f, |
| 5252 1.f, | 5254 1.f, |
| 5253 dummy_max_texture_size, | 5255 dummy_max_texture_size, |
| 5254 false, | 5256 false, |
| 5255 &render_surface_layer_list, | 5257 &render_surface_layer_list, |
| 5256 false); | 5258 false); |
| 5257 | 5259 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5337 identity_matrix, | 5339 identity_matrix, |
| 5338 anchor, | 5340 anchor, |
| 5339 position, | 5341 position, |
| 5340 bounds, | 5342 bounds, |
| 5341 false); | 5343 false); |
| 5342 child->SetDrawsContent(true); | 5344 child->SetDrawsContent(true); |
| 5343 clipping_layer->AddChild(child.Pass()); | 5345 clipping_layer->AddChild(child.Pass()); |
| 5344 root->AddChild(clipping_layer.Pass()); | 5346 root->AddChild(clipping_layer.Pass()); |
| 5345 } | 5347 } |
| 5346 | 5348 |
| 5347 std::vector<LayerImpl*> render_surface_layer_list; | 5349 LayerImplList render_surface_layer_list; |
| 5348 int dummy_max_texture_size = 512; | 5350 int dummy_max_texture_size = 512; |
| 5349 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5351 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5350 root->bounds(), | 5352 root->bounds(), |
| 5351 1.f, | 5353 1.f, |
| 5352 1.f, | 5354 1.f, |
| 5353 dummy_max_texture_size, | 5355 dummy_max_texture_size, |
| 5354 false, | 5356 false, |
| 5355 &render_surface_layer_list, | 5357 &render_surface_layer_list, |
| 5356 false); | 5358 false); |
| 5357 | 5359 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5470 position, | 5472 position, |
| 5471 bounds, | 5473 bounds, |
| 5472 false); | 5474 false); |
| 5473 rotated_leaf->SetDrawsContent(true); | 5475 rotated_leaf->SetDrawsContent(true); |
| 5474 | 5476 |
| 5475 grand_child->AddChild(rotated_leaf.Pass()); | 5477 grand_child->AddChild(rotated_leaf.Pass()); |
| 5476 child->AddChild(grand_child.Pass()); | 5478 child->AddChild(grand_child.Pass()); |
| 5477 root->AddChild(child.Pass()); | 5479 root->AddChild(child.Pass()); |
| 5478 } | 5480 } |
| 5479 | 5481 |
| 5480 std::vector<LayerImpl*> render_surface_layer_list; | 5482 LayerImplList render_surface_layer_list; |
| 5481 int dummy_max_texture_size = 512; | 5483 int dummy_max_texture_size = 512; |
| 5482 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5484 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5483 root->bounds(), | 5485 root->bounds(), |
| 5484 1.f, | 5486 1.f, |
| 5485 1.f, | 5487 1.f, |
| 5486 dummy_max_texture_size, | 5488 dummy_max_texture_size, |
| 5487 false, | 5489 false, |
| 5488 &render_surface_layer_list, | 5490 &render_surface_layer_list, |
| 5489 false); | 5491 false); |
| 5490 | 5492 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5596 identity_matrix, | 5598 identity_matrix, |
| 5597 anchor, | 5599 anchor, |
| 5598 position, | 5600 position, |
| 5599 bounds, | 5601 bounds, |
| 5600 false); | 5602 false); |
| 5601 child->SetDrawsContent(true); | 5603 child->SetDrawsContent(true); |
| 5602 intermediate_layer->AddChild(child.Pass()); | 5604 intermediate_layer->AddChild(child.Pass()); |
| 5603 root->AddChild(intermediate_layer.Pass()); | 5605 root->AddChild(intermediate_layer.Pass()); |
| 5604 } | 5606 } |
| 5605 | 5607 |
| 5606 std::vector<LayerImpl*> render_surface_layer_list; | 5608 LayerImplList render_surface_layer_list; |
| 5607 int dummy_max_texture_size = 512; | 5609 int dummy_max_texture_size = 512; |
| 5608 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5610 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5609 root->bounds(), | 5611 root->bounds(), |
| 5610 1.f, | 5612 1.f, |
| 5611 1.f, | 5613 1.f, |
| 5612 dummy_max_texture_size, | 5614 dummy_max_texture_size, |
| 5613 false, | 5615 false, |
| 5614 &render_surface_layer_list, | 5616 &render_surface_layer_list, |
| 5615 false); | 5617 false); |
| 5616 | 5618 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5713 | 5715 |
| 5714 child1->AddChild(grand_child1.Pass()); | 5716 child1->AddChild(grand_child1.Pass()); |
| 5715 root->AddChild(child1.Pass()); | 5717 root->AddChild(child1.Pass()); |
| 5716 root->AddChild(child2.Pass()); | 5718 root->AddChild(child2.Pass()); |
| 5717 } | 5719 } |
| 5718 | 5720 |
| 5719 LayerImpl* child1 = root->children()[0]; | 5721 LayerImpl* child1 = root->children()[0]; |
| 5720 LayerImpl* child2 = root->children()[1]; | 5722 LayerImpl* child2 = root->children()[1]; |
| 5721 LayerImpl* grand_child1 = child1->children()[0]; | 5723 LayerImpl* grand_child1 = child1->children()[0]; |
| 5722 | 5724 |
| 5723 std::vector<LayerImpl*> render_surface_layer_list; | 5725 LayerImplList render_surface_layer_list; |
| 5724 int dummy_max_texture_size = 512; | 5726 int dummy_max_texture_size = 512; |
| 5725 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5727 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5726 root->bounds(), | 5728 root->bounds(), |
| 5727 1.f, | 5729 1.f, |
| 5728 1.f, | 5730 1.f, |
| 5729 dummy_max_texture_size, | 5731 dummy_max_texture_size, |
| 5730 false, | 5732 false, |
| 5731 &render_surface_layer_list, | 5733 &render_surface_layer_list, |
| 5732 false); | 5734 false); |
| 5733 | 5735 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5866 | 5868 |
| 5867 child1->AddChild(grand_child1.Pass()); | 5869 child1->AddChild(grand_child1.Pass()); |
| 5868 root->AddChild(child1.Pass()); | 5870 root->AddChild(child1.Pass()); |
| 5869 root->AddChild(child2.Pass()); | 5871 root->AddChild(child2.Pass()); |
| 5870 } | 5872 } |
| 5871 | 5873 |
| 5872 LayerImpl* child1 = root->children()[0]; | 5874 LayerImpl* child1 = root->children()[0]; |
| 5873 LayerImpl* child2 = root->children()[1]; | 5875 LayerImpl* child2 = root->children()[1]; |
| 5874 LayerImpl* grand_child1 = child1->children()[0]; | 5876 LayerImpl* grand_child1 = child1->children()[0]; |
| 5875 | 5877 |
| 5876 std::vector<LayerImpl*> render_surface_layer_list; | 5878 LayerImplList render_surface_layer_list; |
| 5877 int dummy_max_texture_size = 512; | 5879 int dummy_max_texture_size = 512; |
| 5878 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5880 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5879 root->bounds(), | 5881 root->bounds(), |
| 5880 1.f, | 5882 1.f, |
| 5881 1.f, | 5883 1.f, |
| 5882 dummy_max_texture_size, | 5884 dummy_max_texture_size, |
| 5883 false, | 5885 false, |
| 5884 &render_surface_layer_list, | 5886 &render_surface_layer_list, |
| 5885 false); | 5887 false); |
| 5886 | 5888 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5948 test_point = gfx::Point(20, 51); | 5950 test_point = gfx::Point(20, 51); |
| 5949 result_layer = LayerTreeHostCommon::FindLayerThatIsHitByPoint( | 5951 result_layer = LayerTreeHostCommon::FindLayerThatIsHitByPoint( |
| 5950 test_point, render_surface_layer_list); | 5952 test_point, render_surface_layer_list); |
| 5951 ASSERT_TRUE(result_layer); | 5953 ASSERT_TRUE(result_layer); |
| 5952 EXPECT_EQ(4, result_layer->id()); | 5954 EXPECT_EQ(4, result_layer->id()); |
| 5953 } | 5955 } |
| 5954 | 5956 |
| 5955 TEST(LayerTreeHostCommonTest, HitCheckingTouchHandlerRegionsForEmptyLayerList) { | 5957 TEST(LayerTreeHostCommonTest, HitCheckingTouchHandlerRegionsForEmptyLayerList) { |
| 5956 // Hit checking on an empty render_surface_layer_list should return a null | 5958 // Hit checking on an empty render_surface_layer_list should return a null |
| 5957 // pointer. | 5959 // pointer. |
| 5958 std::vector<LayerImpl*> render_surface_layer_list; | 5960 LayerImplList render_surface_layer_list; |
| 5959 | 5961 |
| 5960 gfx::Point test_point(0, 0); | 5962 gfx::Point test_point(0, 0); |
| 5961 LayerImpl* result_layer = | 5963 LayerImpl* result_layer = |
| 5962 LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion( | 5964 LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion( |
| 5963 test_point, render_surface_layer_list); | 5965 test_point, render_surface_layer_list); |
| 5964 EXPECT_FALSE(result_layer); | 5966 EXPECT_FALSE(result_layer); |
| 5965 | 5967 |
| 5966 test_point = gfx::Point(10, 20); | 5968 test_point = gfx::Point(10, 20); |
| 5967 result_layer = | 5969 result_layer = |
| 5968 LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion( | 5970 LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 5983 gfx::Size bounds(100, 100); | 5985 gfx::Size bounds(100, 100); |
| 5984 SetLayerPropertiesForTesting(root.get(), | 5986 SetLayerPropertiesForTesting(root.get(), |
| 5985 identity_matrix, | 5987 identity_matrix, |
| 5986 identity_matrix, | 5988 identity_matrix, |
| 5987 anchor, | 5989 anchor, |
| 5988 position, | 5990 position, |
| 5989 bounds, | 5991 bounds, |
| 5990 false); | 5992 false); |
| 5991 root->SetDrawsContent(true); | 5993 root->SetDrawsContent(true); |
| 5992 | 5994 |
| 5993 std::vector<LayerImpl*> render_surface_layer_list; | 5995 LayerImplList render_surface_layer_list; |
| 5994 int dummy_max_texture_size = 512; | 5996 int dummy_max_texture_size = 512; |
| 5995 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 5997 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 5996 root->bounds(), | 5998 root->bounds(), |
| 5997 1.f, | 5999 1.f, |
| 5998 1.f, | 6000 1.f, |
| 5999 dummy_max_texture_size, | 6001 dummy_max_texture_size, |
| 6000 false, | 6002 false, |
| 6001 &render_surface_layer_list, | 6003 &render_surface_layer_list, |
| 6002 false); | 6004 false); |
| 6003 | 6005 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6080 SetLayerPropertiesForTesting(root.get(), | 6082 SetLayerPropertiesForTesting(root.get(), |
| 6081 uninvertible_transform, | 6083 uninvertible_transform, |
| 6082 identity_matrix, | 6084 identity_matrix, |
| 6083 anchor, | 6085 anchor, |
| 6084 position, | 6086 position, |
| 6085 bounds, | 6087 bounds, |
| 6086 false); | 6088 false); |
| 6087 root->SetDrawsContent(true); | 6089 root->SetDrawsContent(true); |
| 6088 root->SetTouchEventHandlerRegion(touch_handler_region); | 6090 root->SetTouchEventHandlerRegion(touch_handler_region); |
| 6089 | 6091 |
| 6090 std::vector<LayerImpl*> render_surface_layer_list; | 6092 LayerImplList render_surface_layer_list; |
| 6091 int dummy_max_texture_size = 512; | 6093 int dummy_max_texture_size = 512; |
| 6092 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 6094 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 6093 root->bounds(), | 6095 root->bounds(), |
| 6094 1.f, | 6096 1.f, |
| 6095 1.f, | 6097 1.f, |
| 6096 dummy_max_texture_size, | 6098 dummy_max_texture_size, |
| 6097 false, | 6099 false, |
| 6098 &render_surface_layer_list, | 6100 &render_surface_layer_list, |
| 6099 false); | 6101 false); |
| 6100 | 6102 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6167 SetLayerPropertiesForTesting(root.get(), | 6169 SetLayerPropertiesForTesting(root.get(), |
| 6168 identity_matrix, | 6170 identity_matrix, |
| 6169 identity_matrix, | 6171 identity_matrix, |
| 6170 anchor, | 6172 anchor, |
| 6171 position, | 6173 position, |
| 6172 bounds, | 6174 bounds, |
| 6173 false); | 6175 false); |
| 6174 root->SetDrawsContent(true); | 6176 root->SetDrawsContent(true); |
| 6175 root->SetTouchEventHandlerRegion(touch_handler_region); | 6177 root->SetTouchEventHandlerRegion(touch_handler_region); |
| 6176 | 6178 |
| 6177 std::vector<LayerImpl*> render_surface_layer_list; | 6179 LayerImplList render_surface_layer_list; |
| 6178 int dummy_max_texture_size = 512; | 6180 int dummy_max_texture_size = 512; |
| 6179 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 6181 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 6180 root->bounds(), | 6182 root->bounds(), |
| 6181 1.f, | 6183 1.f, |
| 6182 1.f, | 6184 1.f, |
| 6183 dummy_max_texture_size, | 6185 dummy_max_texture_size, |
| 6184 false, | 6186 false, |
| 6185 &render_surface_layer_list, | 6187 &render_surface_layer_list, |
| 6186 false); | 6188 false); |
| 6187 | 6189 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6272 | 6274 |
| 6273 // override content bounds and contents scale | 6275 // override content bounds and contents scale |
| 6274 test_layer->SetContentBounds(gfx::Size(100, 100)); | 6276 test_layer->SetContentBounds(gfx::Size(100, 100)); |
| 6275 test_layer->SetContentsScale(2, 2); | 6277 test_layer->SetContentsScale(2, 2); |
| 6276 | 6278 |
| 6277 test_layer->SetDrawsContent(true); | 6279 test_layer->SetDrawsContent(true); |
| 6278 test_layer->SetTouchEventHandlerRegion(touch_handler_region); | 6280 test_layer->SetTouchEventHandlerRegion(touch_handler_region); |
| 6279 root->AddChild(test_layer.Pass()); | 6281 root->AddChild(test_layer.Pass()); |
| 6280 } | 6282 } |
| 6281 | 6283 |
| 6282 std::vector<LayerImpl*> render_surface_layer_list; | 6284 LayerImplList render_surface_layer_list; |
| 6283 int dummy_max_texture_size = 512; | 6285 int dummy_max_texture_size = 512; |
| 6284 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 6286 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 6285 root->bounds(), | 6287 root->bounds(), |
| 6286 1.f, | 6288 1.f, |
| 6287 1.f, | 6289 1.f, |
| 6288 dummy_max_texture_size, | 6290 dummy_max_texture_size, |
| 6289 false, | 6291 false, |
| 6290 &render_surface_layer_list, | 6292 &render_surface_layer_list, |
| 6291 false); | 6293 false); |
| 6292 | 6294 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6380 anchor, | 6382 anchor, |
| 6381 position, | 6383 position, |
| 6382 bounds, | 6384 bounds, |
| 6383 false); | 6385 false); |
| 6384 | 6386 |
| 6385 test_layer->SetDrawsContent(true); | 6387 test_layer->SetDrawsContent(true); |
| 6386 test_layer->SetTouchEventHandlerRegion(touch_handler_region); | 6388 test_layer->SetTouchEventHandlerRegion(touch_handler_region); |
| 6387 root->AddChild(test_layer.Pass()); | 6389 root->AddChild(test_layer.Pass()); |
| 6388 } | 6390 } |
| 6389 | 6391 |
| 6390 std::vector<LayerImpl*> render_surface_layer_list; | 6392 LayerImplList render_surface_layer_list; |
| 6391 int dummy_max_texture_size = 512; | 6393 int dummy_max_texture_size = 512; |
| 6392 float device_scale_factor = 3.f; | 6394 float device_scale_factor = 3.f; |
| 6393 float page_scale_factor = 5.f; | 6395 float page_scale_factor = 5.f; |
| 6394 gfx::Transform page_scale_transform; | 6396 gfx::Transform page_scale_transform; |
| 6395 page_scale_transform.Scale(page_scale_factor, page_scale_factor); | 6397 page_scale_transform.Scale(page_scale_factor, page_scale_factor); |
| 6396 // Applying the page_scale_factor through impl_transform. | 6398 // Applying the page_scale_factor through impl_transform. |
| 6397 root->SetImplTransform(page_scale_transform); | 6399 root->SetImplTransform(page_scale_transform); |
| 6398 gfx::Size scaled_bounds_for_root = gfx::ToCeiledSize( | 6400 gfx::Size scaled_bounds_for_root = gfx::ToCeiledSize( |
| 6399 gfx::ScaleSize(root->bounds(), device_scale_factor * page_scale_factor)); | 6401 gfx::ScaleSize(root->bounds(), device_scale_factor * page_scale_factor)); |
| 6400 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 6402 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6527 anchor, | 6529 anchor, |
| 6528 position, | 6530 position, |
| 6529 bounds, | 6531 bounds, |
| 6530 false); | 6532 false); |
| 6531 child->SetDrawsContent(true); | 6533 child->SetDrawsContent(true); |
| 6532 child->SetTouchEventHandlerRegion(touch_handler_region); | 6534 child->SetTouchEventHandlerRegion(touch_handler_region); |
| 6533 clipping_layer->AddChild(child.Pass()); | 6535 clipping_layer->AddChild(child.Pass()); |
| 6534 root->AddChild(clipping_layer.Pass()); | 6536 root->AddChild(clipping_layer.Pass()); |
| 6535 } | 6537 } |
| 6536 | 6538 |
| 6537 std::vector<LayerImpl*> render_surface_layer_list; | 6539 LayerImplList render_surface_layer_list; |
| 6538 int dummy_max_texture_size = 512; | 6540 int dummy_max_texture_size = 512; |
| 6539 LayerTreeHostCommon::CalculateDrawProperties(root.get(), | 6541 LayerTreeHostCommon::CalculateDrawProperties(root.get(), |
| 6540 root->bounds(), | 6542 root->bounds(), |
| 6541 1.f, | 6543 1.f, |
| 6542 1.f, | 6544 1.f, |
| 6543 dummy_max_texture_size, | 6545 dummy_max_texture_size, |
| 6544 false, | 6546 false, |
| 6545 &render_surface_layer_list, | 6547 &render_surface_layer_list, |
| 6546 false); | 6548 false); |
| 6547 | 6549 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6663 identity_matrix, | 6665 identity_matrix, |
| 6664 gfx::PointF(), | 6666 gfx::PointF(), |
| 6665 gfx::PointF(2.f, 2.f), | 6667 gfx::PointF(2.f, 2.f), |
| 6666 gfx::Size(10, 10), | 6668 gfx::Size(10, 10), |
| 6667 true); | 6669 true); |
| 6668 | 6670 |
| 6669 parent->AddChild(child); | 6671 parent->AddChild(child); |
| 6670 parent->AddChild(child_empty); | 6672 parent->AddChild(child_empty); |
| 6671 parent->AddChild(child_no_scale); | 6673 parent->AddChild(child_no_scale); |
| 6672 | 6674 |
| 6673 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 6675 LayerList render_surface_layer_list; |
| 6674 int dummy_max_texture_size = 512; | 6676 int dummy_max_texture_size = 512; |
| 6675 | 6677 |
| 6676 float device_scale_factor = 2.5f; | 6678 float device_scale_factor = 2.5f; |
| 6677 float page_scale_factor = 1.f; | 6679 float page_scale_factor = 1.f; |
| 6678 | 6680 |
| 6679 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 6681 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 6680 parent->bounds(), | 6682 parent->bounds(), |
| 6681 device_scale_factor, | 6683 device_scale_factor, |
| 6682 page_scale_factor, | 6684 page_scale_factor, |
| 6683 dummy_max_texture_size, | 6685 dummy_max_texture_size, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6798 gfx::PointF(2.f, 2.f), | 6800 gfx::PointF(2.f, 2.f), |
| 6799 gfx::Size(10, 10), | 6801 gfx::Size(10, 10), |
| 6800 true); | 6802 true); |
| 6801 | 6803 |
| 6802 perspective_surface->SetForceRenderSurface(true); | 6804 perspective_surface->SetForceRenderSurface(true); |
| 6803 scale_surface->SetForceRenderSurface(true); | 6805 scale_surface->SetForceRenderSurface(true); |
| 6804 | 6806 |
| 6805 parent->AddChild(perspective_surface); | 6807 parent->AddChild(perspective_surface); |
| 6806 parent->AddChild(scale_surface); | 6808 parent->AddChild(scale_surface); |
| 6807 | 6809 |
| 6808 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 6810 LayerList render_surface_layer_list; |
| 6809 int dummy_max_texture_size = 512; | 6811 int dummy_max_texture_size = 512; |
| 6810 | 6812 |
| 6811 float device_scale_factor = 2.5f; | 6813 float device_scale_factor = 2.5f; |
| 6812 float page_scale_factor = 3.f; | 6814 float page_scale_factor = 3.f; |
| 6813 | 6815 |
| 6814 gfx::Transform page_scale_transform; | 6816 gfx::Transform page_scale_transform; |
| 6815 page_scale_transform.Scale(page_scale_factor, page_scale_factor); | 6817 page_scale_transform.Scale(page_scale_factor, page_scale_factor); |
| 6816 parent->SetImplTransform(page_scale_transform); | 6818 parent->SetImplTransform(page_scale_transform); |
| 6817 | 6819 |
| 6818 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 6820 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6901 identity_matrix, | 6903 identity_matrix, |
| 6902 identity_matrix, | 6904 identity_matrix, |
| 6903 gfx::PointF(), | 6905 gfx::PointF(), |
| 6904 gfx::PointF(), | 6906 gfx::PointF(), |
| 6905 gfx::Size(13, 13), | 6907 gfx::Size(13, 13), |
| 6906 true); | 6908 true); |
| 6907 | 6909 |
| 6908 parent->AddChild(child); | 6910 parent->AddChild(child); |
| 6909 parent->AddChild(child_no_scale); | 6911 parent->AddChild(child_no_scale); |
| 6910 | 6912 |
| 6911 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 6913 LayerList render_surface_layer_list; |
| 6912 int dummy_max_texture_size = 512; | 6914 int dummy_max_texture_size = 512; |
| 6913 | 6915 |
| 6914 float device_scale_factor = 1.7f; | 6916 float device_scale_factor = 1.7f; |
| 6915 float page_scale_factor = 1.f; | 6917 float page_scale_factor = 1.f; |
| 6916 | 6918 |
| 6917 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 6919 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 6918 parent->bounds(), | 6920 parent->bounds(), |
| 6919 device_scale_factor, | 6921 device_scale_factor, |
| 6920 page_scale_factor, | 6922 page_scale_factor, |
| 6921 dummy_max_texture_size, | 6923 dummy_max_texture_size, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7052 | 7054 |
| 7053 // FIXME: Remove this when page_scale_factor is applied in the compositor. | 7055 // FIXME: Remove this when page_scale_factor is applied in the compositor. |
| 7054 // Page scale should not apply to the parent. | 7056 // Page scale should not apply to the parent. |
| 7055 parent->SetBoundsContainPageScale(true); | 7057 parent->SetBoundsContainPageScale(true); |
| 7056 | 7058 |
| 7057 parent->AddChild(child_scale); | 7059 parent->AddChild(child_scale); |
| 7058 parent->AddChild(child_empty); | 7060 parent->AddChild(child_empty); |
| 7059 parent->AddChild(child_no_scale); | 7061 parent->AddChild(child_no_scale); |
| 7060 parent->AddChild(child_no_auto_scale); | 7062 parent->AddChild(child_no_auto_scale); |
| 7061 | 7063 |
| 7062 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 7064 LayerList render_surface_layer_list; |
| 7063 int dummy_max_texture_size = 512; | 7065 int dummy_max_texture_size = 512; |
| 7064 | 7066 |
| 7065 float device_scale_factor = 2.5f; | 7067 float device_scale_factor = 2.5f; |
| 7066 float page_scale_factor = 1.f; | 7068 float page_scale_factor = 1.f; |
| 7067 | 7069 |
| 7068 // FIXME: Remove this when page_scale_factor is applied in the compositor. | 7070 // FIXME: Remove this when page_scale_factor is applied in the compositor. |
| 7069 gfx::Transform page_scale_matrix; | 7071 gfx::Transform page_scale_matrix; |
| 7070 page_scale_matrix.Scale(page_scale_factor, page_scale_factor); | 7072 page_scale_matrix.Scale(page_scale_factor, page_scale_factor); |
| 7071 parent->SetSublayerTransform(page_scale_matrix); | 7073 parent->SetSublayerTransform(page_scale_matrix); |
| 7072 | 7074 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7226 gfx::PointF(2.f, 2.f), | 7228 gfx::PointF(2.f, 2.f), |
| 7227 gfx::Size(10, 10), | 7229 gfx::Size(10, 10), |
| 7228 true); | 7230 true); |
| 7229 | 7231 |
| 7230 // FIXME: Remove this when page_scale_factor is applied in the compositor. | 7232 // FIXME: Remove this when page_scale_factor is applied in the compositor. |
| 7231 // Page scale should not apply to the parent. | 7233 // Page scale should not apply to the parent. |
| 7232 parent->SetBoundsContainPageScale(true); | 7234 parent->SetBoundsContainPageScale(true); |
| 7233 | 7235 |
| 7234 parent->AddChild(child_scale); | 7236 parent->AddChild(child_scale); |
| 7235 | 7237 |
| 7236 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 7238 LayerList render_surface_layer_list; |
| 7237 int dummy_max_texture_size = 512; | 7239 int dummy_max_texture_size = 512; |
| 7238 | 7240 |
| 7239 float device_scale_factor = 2.5f; | 7241 float device_scale_factor = 2.5f; |
| 7240 float page_scale_factor = 0.01f; | 7242 float page_scale_factor = 0.01f; |
| 7241 | 7243 |
| 7242 // FIXME: Remove this when page_scale_factor is applied in the compositor. | 7244 // FIXME: Remove this when page_scale_factor is applied in the compositor. |
| 7243 gfx::Transform page_scale_matrix; | 7245 gfx::Transform page_scale_matrix; |
| 7244 page_scale_matrix.Scale(page_scale_factor, page_scale_factor); | 7246 page_scale_matrix.Scale(page_scale_factor, page_scale_factor); |
| 7245 parent->SetSublayerTransform(page_scale_matrix); | 7247 parent->SetSublayerTransform(page_scale_matrix); |
| 7246 | 7248 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7407 surface_scale->AddChild(surface_scale_child_no_scale); | 7409 surface_scale->AddChild(surface_scale_child_no_scale); |
| 7408 | 7410 |
| 7409 surface_no_scale->SetForceRenderSurface(true); | 7411 surface_no_scale->SetForceRenderSurface(true); |
| 7410 surface_no_scale->AddChild(surface_no_scale_child_scale); | 7412 surface_no_scale->AddChild(surface_no_scale_child_scale); |
| 7411 surface_no_scale->AddChild(surface_no_scale_child_no_scale); | 7413 surface_no_scale->AddChild(surface_no_scale_child_no_scale); |
| 7412 | 7414 |
| 7413 surface_no_auto_scale->SetForceRenderSurface(true); | 7415 surface_no_auto_scale->SetForceRenderSurface(true); |
| 7414 surface_no_auto_scale->AddChild(surface_no_auto_scale_child_scale); | 7416 surface_no_auto_scale->AddChild(surface_no_auto_scale_child_scale); |
| 7415 surface_no_auto_scale->AddChild(surface_no_auto_scale_child_no_scale); | 7417 surface_no_auto_scale->AddChild(surface_no_auto_scale_child_no_scale); |
| 7416 | 7418 |
| 7417 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 7419 LayerList render_surface_layer_list; |
| 7418 int dummy_max_texture_size = 512; | 7420 int dummy_max_texture_size = 512; |
| 7419 | 7421 |
| 7420 double device_scale_factor = 5; | 7422 double device_scale_factor = 5; |
| 7421 double page_scale_factor = 7; | 7423 double page_scale_factor = 7; |
| 7422 | 7424 |
| 7423 // FIXME: Remove this when page_scale_factor is applied in the compositor. | 7425 // FIXME: Remove this when page_scale_factor is applied in the compositor. |
| 7424 gfx::Transform page_scale_matrix; | 7426 gfx::Transform page_scale_matrix; |
| 7425 page_scale_matrix.Scale(page_scale_factor, page_scale_factor); | 7427 page_scale_matrix.Scale(page_scale_factor, page_scale_factor); |
| 7426 parent->SetSublayerTransform(page_scale_matrix); | 7428 parent->SetSublayerTransform(page_scale_matrix); |
| 7427 | 7429 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7616 gfx::PointF(2.f, 2.f), | 7618 gfx::PointF(2.f, 2.f), |
| 7617 gfx::Size(10, 10), | 7619 gfx::Size(10, 10), |
| 7618 true); | 7620 true); |
| 7619 | 7621 |
| 7620 parent->AddChild(child_scale); | 7622 parent->AddChild(child_scale); |
| 7621 | 7623 |
| 7622 // Now put an animating transform on child. | 7624 // Now put an animating transform on child. |
| 7623 int animation_id = AddAnimatedTransformToController( | 7625 int animation_id = AddAnimatedTransformToController( |
| 7624 child_scale->layer_animation_controller(), 10.0, 30, 0); | 7626 child_scale->layer_animation_controller(), 10.0, 30, 0); |
| 7625 | 7627 |
| 7626 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 7628 LayerList render_surface_layer_list; |
| 7627 int dummy_max_texture_size = 512; | 7629 int dummy_max_texture_size = 512; |
| 7628 | 7630 |
| 7629 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 7631 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 7630 parent->bounds(), | 7632 parent->bounds(), |
| 7631 1.f, | 7633 1.f, |
| 7632 1.f, | 7634 1.f, |
| 7633 dummy_max_texture_size, | 7635 dummy_max_texture_size, |
| 7634 false, | 7636 false, |
| 7635 &render_surface_layer_list); | 7637 &render_surface_layer_list); |
| 7636 | 7638 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7699 identity_matrix, | 7701 identity_matrix, |
| 7700 gfx::PointF(), | 7702 gfx::PointF(), |
| 7701 gfx::PointF(), | 7703 gfx::PointF(), |
| 7702 gfx::Size(10, 10), | 7704 gfx::Size(10, 10), |
| 7703 true); | 7705 true); |
| 7704 | 7706 |
| 7705 parent->AddChild(child); | 7707 parent->AddChild(child); |
| 7706 child->AddChild(duplicate_child_non_owner); | 7708 child->AddChild(duplicate_child_non_owner); |
| 7707 child->SetReplicaLayer(replica.get()); | 7709 child->SetReplicaLayer(replica.get()); |
| 7708 | 7710 |
| 7709 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 7711 LayerList render_surface_layer_list; |
| 7710 int dummy_max_texture_size = 512; | 7712 int dummy_max_texture_size = 512; |
| 7711 | 7713 |
| 7712 float device_scale_factor = 1.5f; | 7714 float device_scale_factor = 1.5f; |
| 7713 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 7715 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 7714 parent->bounds(), | 7716 parent->bounds(), |
| 7715 device_scale_factor, | 7717 device_scale_factor, |
| 7716 1, | 7718 1, |
| 7717 dummy_max_texture_size, | 7719 dummy_max_texture_size, |
| 7718 false, | 7720 false, |
| 7719 &render_surface_layer_list); | 7721 &render_surface_layer_list); |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7834 identity_matrix, | 7836 identity_matrix, |
| 7835 gfx::PointF(), | 7837 gfx::PointF(), |
| 7836 gfx::PointF(), | 7838 gfx::PointF(), |
| 7837 gfx::Size(13, 11), | 7839 gfx::Size(13, 11), |
| 7838 true); | 7840 true); |
| 7839 | 7841 |
| 7840 parent->AddChild(child); | 7842 parent->AddChild(child); |
| 7841 child->AddChild(duplicate_child_non_owner); | 7843 child->AddChild(duplicate_child_non_owner); |
| 7842 child->SetReplicaLayer(replica.get()); | 7844 child->SetReplicaLayer(replica.get()); |
| 7843 | 7845 |
| 7844 std::vector<scoped_refptr<Layer> > render_surface_layer_list; | 7846 LayerList render_surface_layer_list; |
| 7845 int dummy_max_texture_size = 512; | 7847 int dummy_max_texture_size = 512; |
| 7846 | 7848 |
| 7847 float device_scale_factor = 1.7f; | 7849 float device_scale_factor = 1.7f; |
| 7848 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), | 7850 LayerTreeHostCommon::CalculateDrawProperties(parent.get(), |
| 7849 parent->bounds(), | 7851 parent->bounds(), |
| 7850 device_scale_factor, | 7852 device_scale_factor, |
| 7851 1.f, | 7853 1.f, |
| 7852 dummy_max_texture_size, | 7854 dummy_max_texture_size, |
| 7853 false, | 7855 false, |
| 7854 &render_surface_layer_list); | 7856 &render_surface_layer_list); |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8095 EXPECT_EQ(can_use_lcd_text_, child_->can_use_lcd_text()); | 8097 EXPECT_EQ(can_use_lcd_text_, child_->can_use_lcd_text()); |
| 8096 EXPECT_EQ(can_use_lcd_text_, grand_child_->can_use_lcd_text()); | 8098 EXPECT_EQ(can_use_lcd_text_, grand_child_->can_use_lcd_text()); |
| 8097 } | 8099 } |
| 8098 | 8100 |
| 8099 INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest, | 8101 INSTANTIATE_TEST_CASE_P(LayerTreeHostCommonTest, |
| 8100 LCDTextTest, | 8102 LCDTextTest, |
| 8101 testing::Combine(testing::Bool(), testing::Bool())); | 8103 testing::Combine(testing::Bool(), testing::Bool())); |
| 8102 | 8104 |
| 8103 } // namespace | 8105 } // namespace |
| 8104 } // namespace cc | 8106 } // namespace cc |
| OLD | NEW |