| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/surfaces/surface_display_output_surface.h" | 5 #include "cc/surfaces/surface_display_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/surfaces/onscreen_display_client.h" | 7 #include "cc/surfaces/onscreen_display_client.h" |
| 8 #include "cc/surfaces/surface_id_allocator.h" | 8 #include "cc/surfaces/surface_id_allocator.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 #include "cc/test/fake_output_surface.h" | 10 #include "cc/test/fake_output_surface.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 } | 76 } |
| 77 | 77 |
| 78 ~SurfaceDisplayOutputSurfaceTest() override {} | 78 ~SurfaceDisplayOutputSurfaceTest() override {} |
| 79 | 79 |
| 80 void SwapBuffersWithDamage(const gfx::Rect& damage_rect_) { | 80 void SwapBuffersWithDamage(const gfx::Rect& damage_rect_) { |
| 81 scoped_ptr<RenderPass> render_pass(RenderPass::Create()); | 81 scoped_ptr<RenderPass> render_pass(RenderPass::Create()); |
| 82 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect_, | 82 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect_, |
| 83 gfx::Transform()); | 83 gfx::Transform()); |
| 84 | 84 |
| 85 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 85 scoped_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 86 frame_data->render_pass_list.push_back(render_pass.Pass()); | 86 frame_data->render_pass_list.push_back(std::move(render_pass)); |
| 87 | 87 |
| 88 CompositorFrame frame; | 88 CompositorFrame frame; |
| 89 frame.delegated_frame_data = frame_data.Pass(); | 89 frame.delegated_frame_data = std::move(frame_data); |
| 90 | 90 |
| 91 surface_display_output_surface_.SwapBuffers(&frame); | 91 surface_display_output_surface_.SwapBuffers(&frame); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void SetUp() override { | 94 void SetUp() override { |
| 95 // Draw the first frame to start in an "unlocked" state. | 95 // Draw the first frame to start in an "unlocked" state. |
| 96 SwapBuffersWithDamage(display_rect_); | 96 SwapBuffersWithDamage(display_rect_); |
| 97 | 97 |
| 98 EXPECT_EQ(0u, output_surface_->num_sent_frames()); | 98 EXPECT_EQ(0u, output_surface_->num_sent_frames()); |
| 99 task_runner_->RunUntilIdle(); | 99 task_runner_->RunUntilIdle(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 157 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
| 158 | 158 |
| 159 SwapBuffersWithDamage(gfx::Rect()); | 159 SwapBuffersWithDamage(gfx::Rect()); |
| 160 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 160 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
| 161 task_runner_->RunUntilIdle(); | 161 task_runner_->RunUntilIdle(); |
| 162 EXPECT_EQ(1u, output_surface_->num_sent_frames()); | 162 EXPECT_EQ(1u, output_surface_->num_sent_frames()); |
| 163 } | 163 } |
| 164 | 164 |
| 165 } // namespace | 165 } // namespace |
| 166 } // namespace cc | 166 } // namespace cc |
| OLD | NEW |