| 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/output/delegating_renderer.h" | 5 #include "cc/output/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.h" | 8 #include "cc/test/layer_tree_test.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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 | 89 |
| 90 virtual void AfterTest() OVERRIDE {} | 90 virtual void AfterTest() OVERRIDE {} |
| 91 | 91 |
| 92 virtual DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, | 92 virtual DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, |
| 93 LayerTreeHostImpl::FrameData* frame, | 93 LayerTreeHostImpl::FrameData* frame, |
| 94 DrawResult draw_result) OVERRIDE { | 94 DrawResult draw_result) OVERRIDE { |
| 95 frame->render_passes.clear(); | 95 frame->render_passes.clear(); |
| 96 frame->render_passes_by_id.clear(); | 96 frame->render_passes_by_id.clear(); |
| 97 | 97 |
| 98 TestRenderPass* child_pass = AddRenderPass( | 98 TestRenderPass* child_pass = AddRenderPass(&frame->render_passes, |
| 99 &frame->render_passes, | 99 RenderPassId(2, 1), |
| 100 RenderPass::Id(2, 1), | 100 gfx::Rect(3, 3, 10, 10), |
| 101 gfx::Rect(3, 3, 10, 10), | 101 gfx::Transform()); |
| 102 gfx::Transform()); | 102 child_pass->AppendOneOfEveryQuadType(host_impl->resource_provider(), |
| 103 child_pass->AppendOneOfEveryQuadType( | 103 RenderPassId(0, 0)); |
| 104 host_impl->resource_provider(), RenderPass::Id(0, 0)); | |
| 105 | 104 |
| 106 TestRenderPass* pass = AddRenderPass( | 105 TestRenderPass* pass = AddRenderPass(&frame->render_passes, |
| 107 &frame->render_passes, | 106 RenderPassId(1, 1), |
| 108 RenderPass::Id(1, 1), | 107 gfx::Rect(3, 3, 10, 10), |
| 109 gfx::Rect(3, 3, 10, 10), | 108 gfx::Transform()); |
| 110 gfx::Transform()); | |
| 111 pass->AppendOneOfEveryQuadType( | 109 pass->AppendOneOfEveryQuadType( |
| 112 host_impl->resource_provider(), child_pass->id); | 110 host_impl->resource_provider(), child_pass->id); |
| 113 return draw_result; | 111 return draw_result; |
| 114 } | 112 } |
| 115 | 113 |
| 116 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 114 virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
| 117 EXPECT_EQ(0u, output_surface_->num_sent_frames()); | 115 EXPECT_EQ(0u, output_surface_->num_sent_frames()); |
| 118 } | 116 } |
| 119 | 117 |
| 120 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, | 118 virtual void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 134 EXPECT_EQ(24u, last_frame.delegated_frame_data->resource_list.size()); | 132 EXPECT_EQ(24u, last_frame.delegated_frame_data->resource_list.size()); |
| 135 | 133 |
| 136 EndTest(); | 134 EndTest(); |
| 137 } | 135 } |
| 138 }; | 136 }; |
| 139 | 137 |
| 140 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F( | 138 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F( |
| 141 DelegatingRendererTestResources); | 139 DelegatingRendererTestResources); |
| 142 | 140 |
| 143 } // namespace cc | 141 } // namespace cc |
| OLD | NEW |