| 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 23 matching lines...) Expand all Loading... |
| 34 display_size_(1920, 1080), | 34 display_size_(1920, 1080), |
| 35 display_rect_(display_size_), | 35 display_rect_(display_size_), |
| 36 context_provider_(TestContextProvider::Create()) { | 36 context_provider_(TestContextProvider::Create()) { |
| 37 surface_manager_.RegisterSurfaceIdNamespace(allocator_.id_namespace()); | 37 surface_manager_.RegisterSurfaceIdNamespace(allocator_.id_namespace()); |
| 38 | 38 |
| 39 std::unique_ptr<FakeOutputSurface> display_output_surface = | 39 std::unique_ptr<FakeOutputSurface> display_output_surface = |
| 40 FakeOutputSurface::Create3d(); | 40 FakeOutputSurface::Create3d(); |
| 41 display_output_surface_ = display_output_surface.get(); | 41 display_output_surface_ = display_output_surface.get(); |
| 42 | 42 |
| 43 std::unique_ptr<BeginFrameSource> begin_frame_source( | 43 std::unique_ptr<BeginFrameSource> begin_frame_source( |
| 44 new BackToBackBeginFrameSource( | 44 new BackToBackBeginFrameSource(task_runner_.get())); |
| 45 base::MakeUnique<DelayBasedTimeSource>(task_runner_.get()))); | |
| 46 | 45 |
| 47 int max_frames_pending = 2; | 46 int max_frames_pending = 2; |
| 48 std::unique_ptr<DisplayScheduler> scheduler(new DisplayScheduler( | 47 std::unique_ptr<DisplayScheduler> scheduler(new DisplayScheduler( |
| 49 begin_frame_source.get(), task_runner_.get(), max_frames_pending)); | 48 begin_frame_source.get(), task_runner_.get(), max_frames_pending)); |
| 50 | 49 |
| 51 display_.reset(new Display( | 50 display_.reset(new Display( |
| 52 &surface_manager_, &bitmap_manager_, &gpu_memory_buffer_manager_, | 51 &surface_manager_, &bitmap_manager_, &gpu_memory_buffer_manager_, |
| 53 RendererSettings(), allocator_.id_namespace(), | 52 RendererSettings(), allocator_.id_namespace(), |
| 54 std::move(begin_frame_source), std::move(display_output_surface), | 53 std::move(begin_frame_source), std::move(display_output_surface), |
| 55 std::move(scheduler), | 54 std::move(scheduler), |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 144 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 146 | 145 |
| 147 SwapBuffersWithDamage(gfx::Rect()); | 146 SwapBuffersWithDamage(gfx::Rect()); |
| 148 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 147 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 149 task_runner_->RunUntilIdle(); | 148 task_runner_->RunUntilIdle(); |
| 150 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); | 149 EXPECT_EQ(1u, display_output_surface_->num_sent_frames()); |
| 151 } | 150 } |
| 152 | 151 |
| 153 } // namespace | 152 } // namespace |
| 154 } // namespace cc | 153 } // namespace cc |
| OLD | NEW |