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.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2579 | 2579 |
2580 // Positions remain in layout pixels. | 2580 // Positions remain in layout pixels. |
2581 EXPECT_EQ(gfx::PointF(), root->position()); | 2581 EXPECT_EQ(gfx::PointF(), root->position()); |
2582 EXPECT_EQ(gfx::PointF(2.f, 2.f), child->position()); | 2582 EXPECT_EQ(gfx::PointF(2.f, 2.f), child->position()); |
2583 | 2583 |
2584 // Compute all the layer transforms for the frame. | 2584 // Compute all the layer transforms for the frame. |
2585 LayerTreeHostImpl::FrameData frame_data; | 2585 LayerTreeHostImpl::FrameData frame_data; |
2586 impl->PrepareToDraw(&frame_data); | 2586 impl->PrepareToDraw(&frame_data); |
2587 impl->DidDrawAllLayers(frame_data); | 2587 impl->DidDrawAllLayers(frame_data); |
2588 | 2588 |
2589 const LayerImplList& render_surface_layer_list = | 2589 const RenderSurfaceList& render_surface_list = |
2590 *frame_data.render_surface_layer_list; | 2590 *frame_data.render_surface_list; |
2591 | 2591 |
2592 // Both layers should be drawing into the root render surface. | 2592 // Both layers should be drawing into the root render surface. |
2593 ASSERT_EQ(1u, render_surface_layer_list.size()); | 2593 ASSERT_EQ(1u, render_surface_list.size()); |
2594 ASSERT_EQ(root->GetRenderSurface(), | 2594 ASSERT_EQ(root->GetRenderSurface(), render_surface_list[0]); |
2595 render_surface_layer_list[0]->GetRenderSurface()); | 2595 ASSERT_EQ(2, root->GetRenderSurface()->num_contributors()); |
2596 ASSERT_EQ(2u, root->GetRenderSurface()->layer_list().size()); | |
2597 | 2596 |
2598 // The root render surface is the size of the viewport. | 2597 // The root render surface is the size of the viewport. |
2599 EXPECT_EQ(gfx::Rect(0, 0, 60, 60), | 2598 EXPECT_EQ(gfx::Rect(0, 0, 60, 60), |
2600 root->GetRenderSurface()->content_rect()); | 2599 root->GetRenderSurface()->content_rect()); |
2601 | 2600 |
2602 // The max tiling scale of the child should be scaled. | 2601 // The max tiling scale of the child should be scaled. |
2603 EXPECT_FLOAT_EQ(1.5f, child->MaximumTilingContentsScale()); | 2602 EXPECT_FLOAT_EQ(1.5f, child->MaximumTilingContentsScale()); |
2604 | 2603 |
2605 gfx::Transform scale_transform; | 2604 gfx::Transform scale_transform; |
2606 scale_transform.Scale(impl->active_tree()->device_scale_factor(), | 2605 scale_transform.Scale(impl->active_tree()->device_scale_factor(), |
(...skipping 5042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7649 void AfterTest() override {} | 7648 void AfterTest() override {} |
7650 | 7649 |
7651 private: | 7650 private: |
7652 bool received_ack_ = false; | 7651 bool received_ack_ = false; |
7653 }; | 7652 }; |
7654 | 7653 |
7655 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDiscardAckAfterRelease); | 7654 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDiscardAckAfterRelease); |
7656 | 7655 |
7657 } // namespace | 7656 } // namespace |
7658 } // namespace cc | 7657 } // namespace cc |
OLD | NEW |