| 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/direct_compositor_frame_sink.h" | 5 #include "cc/surfaces/direct_compositor_frame_sink.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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 context_provider_, nullptr)); | 60 context_provider_, nullptr)); |
| 61 | 61 |
| 62 compositor_frame_sink_->BindToClient(&compositor_frame_sink_client_); | 62 compositor_frame_sink_->BindToClient(&compositor_frame_sink_client_); |
| 63 display_->Resize(display_size_); | 63 display_->Resize(display_size_); |
| 64 display_->SetVisible(true); | 64 display_->SetVisible(true); |
| 65 | 65 |
| 66 EXPECT_FALSE( | 66 EXPECT_FALSE( |
| 67 compositor_frame_sink_client_.did_lose_compositor_frame_sink_called()); | 67 compositor_frame_sink_client_.did_lose_compositor_frame_sink_called()); |
| 68 } | 68 } |
| 69 | 69 |
| 70 ~DirectCompositorFrameSinkTest() override {} | 70 ~DirectCompositorFrameSinkTest() override { |
| 71 compositor_frame_sink_->DetachFromClient(); |
| 72 } |
| 71 | 73 |
| 72 void SwapBuffersWithDamage(const gfx::Rect& damage_rect) { | 74 void SwapBuffersWithDamage(const gfx::Rect& damage_rect) { |
| 73 std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); | 75 std::unique_ptr<RenderPass> render_pass(RenderPass::Create()); |
| 74 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect, | 76 render_pass->SetNew(RenderPassId(1, 1), display_rect_, damage_rect, |
| 75 gfx::Transform()); | 77 gfx::Transform()); |
| 76 | 78 |
| 77 auto frame_data = base::MakeUnique<DelegatedFrameData>(); | 79 auto frame_data = base::MakeUnique<DelegatedFrameData>(); |
| 78 frame_data->render_pass_list.push_back(std::move(render_pass)); | 80 frame_data->render_pass_list.push_back(std::move(render_pass)); |
| 79 | 81 |
| 80 CompositorFrame frame; | 82 CompositorFrame frame; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 148 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 147 | 149 |
| 148 SwapBuffersWithDamage(gfx::Rect()); | 150 SwapBuffersWithDamage(gfx::Rect()); |
| 149 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 151 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 150 task_runner_->RunUntilIdle(); | 152 task_runner_->RunUntilIdle(); |
| 151 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 153 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 152 } | 154 } |
| 153 | 155 |
| 154 } // namespace | 156 } // namespace |
| 155 } // namespace cc | 157 } // namespace cc |
| OLD | NEW |