| OLD | NEW |
| 1 //// Copyright 2011 The Chromium Authors. All rights reserved. | 1 //// Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "cc/animation/keyframed_animation_curve.h" | 10 #include "cc/animation/keyframed_animation_curve.h" |
| (...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2663 // deleted). | 2663 // deleted). |
| 2664 EXPECT_EQ(gfx::Rect(grand_child->bounds()), | 2664 EXPECT_EQ(gfx::Rect(grand_child->bounds()), |
| 2665 grand_child->visible_layer_rect()); | 2665 grand_child->visible_layer_rect()); |
| 2666 } | 2666 } |
| 2667 | 2667 |
| 2668 TEST_F(LayerTreeHostCommonTest, | 2668 TEST_F(LayerTreeHostCommonTest, |
| 2669 OcclusionForLayerWithUninvertibleDrawTransform) { | 2669 OcclusionForLayerWithUninvertibleDrawTransform) { |
| 2670 FakeImplProxy proxy; | 2670 FakeImplProxy proxy; |
| 2671 TestSharedBitmapManager shared_bitmap_manager; | 2671 TestSharedBitmapManager shared_bitmap_manager; |
| 2672 TestTaskGraphRunner task_graph_runner; | 2672 TestTaskGraphRunner task_graph_runner; |
| 2673 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); | |
| 2674 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, | 2673 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, |
| 2675 &task_graph_runner); | 2674 &task_graph_runner); |
| 2676 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); | 2675 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); |
| 2677 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); | 2676 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); |
| 2678 scoped_ptr<LayerImpl> grand_child = | 2677 scoped_ptr<LayerImpl> grand_child = |
| 2679 LayerImpl::Create(host_impl.active_tree(), 3); | 2678 LayerImpl::Create(host_impl.active_tree(), 3); |
| 2680 scoped_ptr<LayerImpl> occluding_child = | 2679 scoped_ptr<LayerImpl> occluding_child = |
| 2681 LayerImpl::Create(host_impl.active_tree(), 4); | 2680 LayerImpl::Create(host_impl.active_tree(), 4); |
| 2682 child->SetDrawsContent(true); | 2681 child->SetDrawsContent(true); |
| 2683 grand_child->SetDrawsContent(true); | 2682 grand_child->SetDrawsContent(true); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2703 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix, | 2702 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix, |
| 2704 gfx::Point3F(), gfx::PointF(), | 2703 gfx::Point3F(), gfx::PointF(), |
| 2705 gfx::Size(200, 200), false, false, false); | 2704 gfx::Size(200, 200), false, false, false); |
| 2706 | 2705 |
| 2707 host_impl.SetViewportSize(root->bounds()); | 2706 host_impl.SetViewportSize(root->bounds()); |
| 2708 | 2707 |
| 2709 child->AddChild(grand_child.Pass()); | 2708 child->AddChild(grand_child.Pass()); |
| 2710 root->AddChild(child.Pass()); | 2709 root->AddChild(child.Pass()); |
| 2711 root->AddChild(occluding_child.Pass()); | 2710 root->AddChild(occluding_child.Pass()); |
| 2712 host_impl.active_tree()->SetRootLayer(root.Pass()); | 2711 host_impl.active_tree()->SetRootLayer(root.Pass()); |
| 2713 host_impl.InitializeRenderer(output_surface.get()); | 2712 host_impl.InitializeRenderer(FakeOutputSurface::Create3d()); |
| 2714 bool update_lcd_text = false; | 2713 bool update_lcd_text = false; |
| 2715 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); | 2714 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); |
| 2716 | 2715 |
| 2717 LayerImpl* grand_child_ptr = | 2716 LayerImpl* grand_child_ptr = |
| 2718 host_impl.active_tree()->root_layer()->children()[0]->children()[0]; | 2717 host_impl.active_tree()->root_layer()->children()[0]->children()[0]; |
| 2719 | 2718 |
| 2720 // Though all layers have invertible transforms, matrix multiplication using | 2719 // Though all layers have invertible transforms, matrix multiplication using |
| 2721 // floating-point math makes the draw transform uninvertible. | 2720 // floating-point math makes the draw transform uninvertible. |
| 2722 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible()); | 2721 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible()); |
| 2723 | 2722 |
| (...skipping 5185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7909 gfx::PointF(), gfx::Size(30, 30), true, false, | 7908 gfx::PointF(), gfx::Size(30, 30), true, false, |
| 7910 false); | 7909 false); |
| 7911 | 7910 |
| 7912 ExecuteCalculateDrawProperties(root); | 7911 ExecuteCalculateDrawProperties(root); |
| 7913 | 7912 |
| 7914 EXPECT_EQ(gfx::Rect(30, 30), test_layer->clip_rect()); | 7913 EXPECT_EQ(gfx::Rect(30, 30), test_layer->clip_rect()); |
| 7915 } | 7914 } |
| 7916 | 7915 |
| 7917 } // namespace | 7916 } // namespace |
| 7918 } // namespace cc | 7917 } // namespace cc |
| OLD | NEW |