| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/delegating_renderer.h" | 5 #include "cc/delegating_renderer.h" |
| 6 | 6 |
| 7 #include "cc/test/fake_output_surface.h" | 7 #include "cc/test/fake_output_surface.h" |
| 8 #include "cc/test/layer_tree_test_common.h" | 8 #include "cc/test/layer_tree_test_common.h" |
| 9 #include "cc/test/render_pass_test_common.h" | 9 #include "cc/test/render_pass_test_common.h" |
| 10 #include "cc/test/render_pass_test_utils.h" | 10 #include "cc/test/render_pass_test_utils.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 DelegatedFrameData* last_frame_data = last_frame.delegated_frame_data.get(); | 63 DelegatedFrameData* last_frame_data = last_frame.delegated_frame_data.get(); |
| 64 ASSERT_TRUE(last_frame.delegated_frame_data); | 64 ASSERT_TRUE(last_frame.delegated_frame_data); |
| 65 EXPECT_FALSE(last_frame.gl_frame_data); | 65 EXPECT_FALSE(last_frame.gl_frame_data); |
| 66 EXPECT_EQ( | 66 EXPECT_EQ( |
| 67 gfx::Rect(host_impl->deviceViewportSize()).ToString(), | 67 gfx::Rect(host_impl->deviceViewportSize()).ToString(), |
| 68 last_frame_data->render_pass_list.back()->output_rect.ToString()); | 68 last_frame_data->render_pass_list.back()->output_rect.ToString()); |
| 69 EXPECT_EQ(0.5f, last_frame.metadata.min_page_scale_factor); | 69 EXPECT_EQ(0.5f, last_frame.metadata.min_page_scale_factor); |
| 70 EXPECT_EQ(4.f, last_frame.metadata.max_page_scale_factor); | 70 EXPECT_EQ(4.f, last_frame.metadata.max_page_scale_factor); |
| 71 | 71 |
| 72 EXPECT_EQ( | 72 EXPECT_EQ( |
| 73 0u, last_frame.delegated_frame_data->resource_list.resources.size()); | 73 0u, last_frame.delegated_frame_data->resource_list.size()); |
| 74 EXPECT_EQ(1u, last_frame.delegated_frame_data->render_pass_list.size()); | 74 EXPECT_EQ(1u, last_frame.delegated_frame_data->render_pass_list.size()); |
| 75 | 75 |
| 76 endTest(); | 76 endTest(); |
| 77 } | 77 } |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestDraw) | 80 SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestDraw) |
| 81 | 81 |
| 82 class DelegatingRendererTestResources : public DelegatingRendererTest { | 82 class DelegatingRendererTestResources : public DelegatingRendererTest { |
| 83 public: | 83 public: |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 118 |
| 119 CompositorFrame& last_frame = output_surface_->last_sent_frame(); | 119 CompositorFrame& last_frame = output_surface_->last_sent_frame(); |
| 120 ASSERT_TRUE(last_frame.delegated_frame_data); | 120 ASSERT_TRUE(last_frame.delegated_frame_data); |
| 121 | 121 |
| 122 EXPECT_EQ(2u, last_frame.delegated_frame_data->render_pass_list.size()); | 122 EXPECT_EQ(2u, last_frame.delegated_frame_data->render_pass_list.size()); |
| 123 // Each render pass has 7 resources in it. And the root render pass has a | 123 // Each render pass has 7 resources in it. And the root render pass has a |
| 124 // mask resource used when drawing the child render pass. The number 7 may | 124 // mask resource used when drawing the child render pass. The number 7 may |
| 125 // change if AppendOneOfEveryQuadType is updated, and the value here should | 125 // change if AppendOneOfEveryQuadType is updated, and the value here should |
| 126 // be updated accordingly. | 126 // be updated accordingly. |
| 127 EXPECT_EQ( | 127 EXPECT_EQ( |
| 128 15u, last_frame.delegated_frame_data->resource_list.resources.size()); | 128 15u, last_frame.delegated_frame_data->resource_list.size()); |
| 129 | 129 |
| 130 endTest(); | 130 endTest(); |
| 131 } | 131 } |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestResources) | 134 SINGLE_AND_MULTI_THREAD_TEST_F(DelegatingRendererTestResources) |
| 135 | 135 |
| 136 } // namespace cc | 136 } // namespace cc |
| OLD | NEW |