| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "cc/output/renderer_settings.h" | 9 #include "cc/output/renderer_settings.h" |
| 10 #include "cc/output/texture_mailbox_deleter.h" | 10 #include "cc/output/texture_mailbox_deleter.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); | 71 std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); |
| 72 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect, | 72 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect, |
| 73 gfx::Transform()); | 73 gfx::Transform()); |
| 74 | 74 |
| 75 std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); | 75 std::unique_ptr<DelegatedFrameData> frame_data(new DelegatedFrameData); |
| 76 frame_data->render_pass_list.push_back(std::move(render_pass)); | 76 frame_data->render_pass_list.push_back(std::move(render_pass)); |
| 77 | 77 |
| 78 CompositorFrame frame; | 78 CompositorFrame frame; |
| 79 frame.delegated_frame_data = std::move(frame_data); | 79 frame.delegated_frame_data = std::move(frame_data); |
| 80 | 80 |
| 81 delegated_output_surface_->SwapBuffers(&frame); | 81 delegated_output_surface_->SwapBuffers(std::move(frame)); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void SetUp() override { | 84 void SetUp() override { |
| 85 // Draw the first frame to start in an "unlocked" state. | 85 // Draw the first frame to start in an "unlocked" state. |
| 86 SwapBuffersWithDamage(display_rect_); | 86 SwapBuffersWithDamage(display_rect_); |
| 87 | 87 |
| 88 EXPECT_EQ(0u, display_output_surface_->num_sent_frames()); | 88 EXPECT_EQ(0u, display_output_surface_->num_sent_frames()); |
| 89 task_runner_->RunUntilIdle(); | 89 task_runner_->RunUntilIdle(); |
| 90 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 90 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 91 } | 91 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 145 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 146 | 146 |
| 147 SwapBuffersWithDamage(gfx::Rect()); | 147 SwapBuffersWithDamage(gfx::Rect()); |
| 148 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 148 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 149 task_runner_->RunUntilIdle(); | 149 task_runner_->RunUntilIdle(); |
| 150 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 150 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace | 153 } // namespace |
| 154 } // namespace cc | 154 } // namespace cc |
| OLD | NEW |