| 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 2677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2688 // deleted). | 2688 // deleted). |
| 2689 EXPECT_EQ(gfx::Rect(grand_child->bounds()), | 2689 EXPECT_EQ(gfx::Rect(grand_child->bounds()), |
| 2690 grand_child->visible_layer_rect()); | 2690 grand_child->visible_layer_rect()); |
| 2691 } | 2691 } |
| 2692 | 2692 |
| 2693 TEST_F(LayerTreeHostCommonTest, | 2693 TEST_F(LayerTreeHostCommonTest, |
| 2694 OcclusionForLayerWithUninvertibleDrawTransform) { | 2694 OcclusionForLayerWithUninvertibleDrawTransform) { |
| 2695 FakeImplProxy proxy; | 2695 FakeImplProxy proxy; |
| 2696 TestSharedBitmapManager shared_bitmap_manager; | 2696 TestSharedBitmapManager shared_bitmap_manager; |
| 2697 TestTaskGraphRunner task_graph_runner; | 2697 TestTaskGraphRunner task_graph_runner; |
| 2698 scoped_ptr<OutputSurface> output_surface = FakeOutputSurface::Create3d(); |
| 2698 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, | 2699 FakeLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager, |
| 2699 &task_graph_runner); | 2700 &task_graph_runner); |
| 2700 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); | 2701 scoped_ptr<LayerImpl> root = LayerImpl::Create(host_impl.active_tree(), 1); |
| 2701 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); | 2702 scoped_ptr<LayerImpl> child = LayerImpl::Create(host_impl.active_tree(), 2); |
| 2702 scoped_ptr<LayerImpl> grand_child = | 2703 scoped_ptr<LayerImpl> grand_child = |
| 2703 LayerImpl::Create(host_impl.active_tree(), 3); | 2704 LayerImpl::Create(host_impl.active_tree(), 3); |
| 2704 scoped_ptr<LayerImpl> occluding_child = | 2705 scoped_ptr<LayerImpl> occluding_child = |
| 2705 LayerImpl::Create(host_impl.active_tree(), 4); | 2706 LayerImpl::Create(host_impl.active_tree(), 4); |
| 2706 child->SetDrawsContent(true); | 2707 child->SetDrawsContent(true); |
| 2707 grand_child->SetDrawsContent(true); | 2708 grand_child->SetDrawsContent(true); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2727 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix, | 2728 SetLayerPropertiesForTesting(occluding_child.get(), identity_matrix, |
| 2728 gfx::Point3F(), gfx::PointF(), | 2729 gfx::Point3F(), gfx::PointF(), |
| 2729 gfx::Size(200, 200), false, false, false); | 2730 gfx::Size(200, 200), false, false, false); |
| 2730 | 2731 |
| 2731 host_impl.SetViewportSize(root->bounds()); | 2732 host_impl.SetViewportSize(root->bounds()); |
| 2732 | 2733 |
| 2733 child->AddChild(grand_child.Pass()); | 2734 child->AddChild(grand_child.Pass()); |
| 2734 root->AddChild(child.Pass()); | 2735 root->AddChild(child.Pass()); |
| 2735 root->AddChild(occluding_child.Pass()); | 2736 root->AddChild(occluding_child.Pass()); |
| 2736 host_impl.active_tree()->SetRootLayer(root.Pass()); | 2737 host_impl.active_tree()->SetRootLayer(root.Pass()); |
| 2737 host_impl.InitializeRenderer(FakeOutputSurface::Create3d()); | 2738 host_impl.InitializeRenderer(output_surface.get()); |
| 2738 bool update_lcd_text = false; | 2739 bool update_lcd_text = false; |
| 2739 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); | 2740 host_impl.active_tree()->UpdateDrawProperties(update_lcd_text); |
| 2740 | 2741 |
| 2741 LayerImpl* grand_child_ptr = | 2742 LayerImpl* grand_child_ptr = |
| 2742 host_impl.active_tree()->root_layer()->children()[0]->children()[0]; | 2743 host_impl.active_tree()->root_layer()->children()[0]->children()[0]; |
| 2743 | 2744 |
| 2744 // Though all layers have invertible transforms, matrix multiplication using | 2745 // Though all layers have invertible transforms, matrix multiplication using |
| 2745 // floating-point math makes the draw transform uninvertible. | 2746 // floating-point math makes the draw transform uninvertible. |
| 2746 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible()); | 2747 EXPECT_FALSE(grand_child_ptr->draw_transform().IsInvertible()); |
| 2747 | 2748 |
| (...skipping 5185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7933 gfx::PointF(), gfx::Size(30, 30), true, false, | 7934 gfx::PointF(), gfx::Size(30, 30), true, false, |
| 7934 false); | 7935 false); |
| 7935 | 7936 |
| 7936 ExecuteCalculateDrawProperties(root); | 7937 ExecuteCalculateDrawProperties(root); |
| 7937 | 7938 |
| 7938 EXPECT_EQ(gfx::Rect(30, 30), test_layer->clip_rect()); | 7939 EXPECT_EQ(gfx::Rect(30, 30), test_layer->clip_rect()); |
| 7939 } | 7940 } |
| 7940 | 7941 |
| 7941 } // namespace | 7942 } // namespace |
| 7942 } // namespace cc | 7943 } // namespace cc |
| OLD | NEW |