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 "services/ui/gpu/gpu_main.h" | 5 #include "services/ui/gpu/gpu_main.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "gpu/ipc/common/gpu_memory_buffer_support.h" | 9 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
10 #include "gpu/ipc/gpu_in_process_thread_service.h" | 10 #include "gpu/ipc/gpu_in_process_thread_service.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 gpu_command_service_ = new gpu::GpuInProcessThreadService( | 151 gpu_command_service_ = new gpu::GpuInProcessThreadService( |
152 gpu_thread_.task_runner(), gpu_service_->sync_point_manager(), | 152 gpu_thread_.task_runner(), gpu_service_->sync_point_manager(), |
153 gpu_service_->mailbox_manager(), gpu_service_->share_group()); | 153 gpu_service_->mailbox_manager(), gpu_service_->share_group()); |
154 | 154 |
155 // |gpu_memory_buffer_factory_| is null in tests. | 155 // |gpu_memory_buffer_factory_| is null in tests. |
156 gpu::ImageFactory* image_factory = | 156 gpu::ImageFactory* image_factory = |
157 gpu_memory_buffer_factory_ ? gpu_memory_buffer_factory_->AsImageFactory() | 157 gpu_memory_buffer_factory_ ? gpu_memory_buffer_factory_->AsImageFactory() |
158 : nullptr; | 158 : nullptr; |
159 | 159 |
160 mojom::GpuServicePtr gpu_service; | 160 mojom::GpuServicePtr gpu_service; |
161 mojom::GpuServiceRequest gpu_service_request = | 161 mojom::GpuServiceRequest gpu_service_request(&gpu_service); |
162 mojo::MakeRequest(&gpu_service); | |
163 | 162 |
164 if (gpu_thread_.task_runner()->BelongsToCurrentThread()) { | 163 if (gpu_thread_.task_runner()->BelongsToCurrentThread()) { |
165 // If the DisplayCompositor creation was delayed because GpuService | 164 // If the DisplayCompositor creation was delayed because GpuService |
166 // had not been created yet, then this is called, in gpu thread, right after | 165 // had not been created yet, then this is called, in gpu thread, right after |
167 // GpuService is created. | 166 // GpuService is created. |
168 BindGpuInternalOnGpuThread(std::move(gpu_service_request)); | 167 BindGpuInternalOnGpuThread(std::move(gpu_service_request)); |
169 } else { | 168 } else { |
170 gpu_thread_.task_runner()->PostTask( | 169 gpu_thread_.task_runner()->PostTask( |
171 FROM_HERE, | 170 FROM_HERE, |
172 base::Bind(&GpuMain::BindGpuInternalOnGpuThread, base::Unretained(this), | 171 base::Bind(&GpuMain::BindGpuInternalOnGpuThread, base::Unretained(this), |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // TODO(sad): https://crbug.com/645602 | 231 // TODO(sad): https://crbug.com/645602 |
233 } | 232 } |
234 | 233 |
235 bool GpuMain::EnsureSandboxInitialized( | 234 bool GpuMain::EnsureSandboxInitialized( |
236 gpu::GpuWatchdogThread* watchdog_thread) { | 235 gpu::GpuWatchdogThread* watchdog_thread) { |
237 // TODO(sad): https://crbug.com/645602 | 236 // TODO(sad): https://crbug.com/645602 |
238 return true; | 237 return true; |
239 } | 238 } |
240 | 239 |
241 } // namespace ui | 240 } // namespace ui |
OLD | NEW |