| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/test/pixel_test_delegating_output_surface.h" | 5 #include "cc/test/pixel_test_delegating_output_surface.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "cc/output/begin_frame_args.h" | 13 #include "cc/output/begin_frame_args.h" |
| 14 #include "cc/output/compositor_frame_ack.h" | 14 #include "cc/output/compositor_frame_ack.h" |
| 15 #include "cc/output/direct_renderer.h" | 15 #include "cc/output/direct_renderer.h" |
| 16 #include "cc/scheduler/delay_based_time_source.h" |
| 16 #include "cc/test/begin_frame_args_test.h" | 17 #include "cc/test/begin_frame_args_test.h" |
| 17 #include "cc/test/pixel_test_output_surface.h" | 18 #include "cc/test/pixel_test_output_surface.h" |
| 18 #include "cc/test/pixel_test_software_output_device.h" | 19 #include "cc/test/pixel_test_software_output_device.h" |
| 19 #include "cc/test/test_in_process_context_provider.h" | 20 #include "cc/test/test_in_process_context_provider.h" |
| 20 | 21 |
| 21 static constexpr uint32_t kCompositorSurfaceNamespace = 1; | 22 static constexpr uint32_t kCompositorSurfaceNamespace = 1; |
| 22 | 23 |
| 23 namespace cc { | 24 namespace cc { |
| 24 | 25 |
| 25 PixelTestDelegatingOutputSurface::PixelTestDelegatingOutputSurface( | 26 PixelTestDelegatingOutputSurface::PixelTestDelegatingOutputSurface( |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 display_.reset(new Display(surface_manager_.get(), shared_bitmap_manager_, | 85 display_.reset(new Display(surface_manager_.get(), shared_bitmap_manager_, |
| 85 gpu_memory_buffer_manager_, RendererSettings(), | 86 gpu_memory_buffer_manager_, RendererSettings(), |
| 86 surface_id_allocator_->id_namespace(), task_runner, | 87 surface_id_allocator_->id_namespace(), task_runner, |
| 87 std::move(output_surface))); | 88 std::move(output_surface))); |
| 88 display_->SetEnlargePassTextureAmountForTesting(enlarge_pass_texture_amount_); | 89 display_->SetEnlargePassTextureAmountForTesting(enlarge_pass_texture_amount_); |
| 89 | 90 |
| 90 if (synchronous_composite_) { | 91 if (synchronous_composite_) { |
| 91 bool init = display_->InitializeSynchronous(&display_client_); | 92 bool init = display_->InitializeSynchronous(&display_client_); |
| 92 CHECK(init); | 93 CHECK(init); |
| 93 } else { | 94 } else { |
| 94 begin_frame_source_.reset(new BackToBackBeginFrameSource(task_runner)); | 95 begin_frame_source_.reset(new BackToBackBeginFrameSource( |
| 96 base::MakeUnique<DelayBasedTimeSource>(task_runner))); |
| 95 display_->SetBeginFrameSource(begin_frame_source_.get()); | 97 display_->SetBeginFrameSource(begin_frame_source_.get()); |
| 96 | 98 |
| 97 bool init = display_->Initialize(&display_client_); | 99 bool init = display_->Initialize(&display_client_); |
| 98 CHECK(init); | 100 CHECK(init); |
| 99 } | 101 } |
| 100 | 102 |
| 101 return true; | 103 return true; |
| 102 } | 104 } |
| 103 | 105 |
| 104 void PixelTestDelegatingOutputSurface::DetachFromClient() { | 106 void PixelTestDelegatingOutputSurface::DetachFromClient() { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 ack.resources = resources; | 165 ack.resources = resources; |
| 164 client_->ReclaimResources(&ack); | 166 client_->ReclaimResources(&ack); |
| 165 } | 167 } |
| 166 | 168 |
| 167 void PixelTestDelegatingOutputSurface::SetBeginFrameSource( | 169 void PixelTestDelegatingOutputSurface::SetBeginFrameSource( |
| 168 BeginFrameSource* begin_frame_source) { | 170 BeginFrameSource* begin_frame_source) { |
| 169 client_->SetBeginFrameSource(begin_frame_source); | 171 client_->SetBeginFrameSource(begin_frame_source); |
| 170 } | 172 } |
| 171 | 173 |
| 172 } // namespace cc | 174 } // namespace cc |
| OLD | NEW |