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" |
11 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" | 11 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
12 #include "gpu/ipc/service/gpu_watchdog_thread.h" | 12 #include "gpu/ipc/service/gpu_watchdog_thread.h" |
13 #include "services/ui/common/mus_gpu_memory_buffer_manager.h" | 13 #include "services/ui/common/server_gpu_memory_buffer_manager.h" |
14 #include "services/ui/gpu/gpu_service_internal.h" | 14 #include "services/ui/gpu/gpu_service_internal.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 #if defined(OS_WIN) | 18 #if defined(OS_WIN) |
19 std::unique_ptr<base::MessagePump> CreateMessagePumpWin() { | 19 std::unique_ptr<base::MessagePump> CreateMessagePumpWin() { |
20 base::MessagePumpForGpu::InitFactory(); | 20 base::MessagePumpForGpu::InitFactory(); |
21 return base::MessageLoop::CreateMessagePumpForType( | 21 return base::MessageLoop::CreateMessagePumpForType( |
22 base::MessageLoop::TYPE_UI); | 22 base::MessageLoop::TYPE_UI); |
23 } | 23 } |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 mojom::GpuServiceInternalPtrInfo gpu_service_info, | 186 mojom::GpuServiceInternalPtrInfo gpu_service_info, |
187 cc::mojom::DisplayCompositorRequest request, | 187 cc::mojom::DisplayCompositorRequest request, |
188 cc::mojom::DisplayCompositorClientPtrInfo client_info) { | 188 cc::mojom::DisplayCompositorClientPtrInfo client_info) { |
189 DCHECK(!display_compositor_); | 189 DCHECK(!display_compositor_); |
190 cc::mojom::DisplayCompositorClientPtr client; | 190 cc::mojom::DisplayCompositorClientPtr client; |
191 client.Bind(std::move(client_info)); | 191 client.Bind(std::move(client_info)); |
192 | 192 |
193 gpu_internal_.Bind(std::move(gpu_service_info)); | 193 gpu_internal_.Bind(std::move(gpu_service_info)); |
194 | 194 |
195 display_compositor_ = base::MakeUnique<DisplayCompositor>( | 195 display_compositor_ = base::MakeUnique<DisplayCompositor>( |
196 gpu_command_service_, base::MakeUnique<MusGpuMemoryBufferManager>( | 196 gpu_command_service_, base::MakeUnique<ServerGpuMemoryBufferManager>( |
197 gpu_internal_.get(), 1 /* client_id */), | 197 gpu_internal_.get(), 1 /* client_id */), |
198 image_factory, std::move(request), std::move(client)); | 198 image_factory, std::move(request), std::move(client)); |
199 } | 199 } |
200 | 200 |
201 void GpuMain::TearDownOnCompositorThread() { | 201 void GpuMain::TearDownOnCompositorThread() { |
202 display_compositor_.reset(); | 202 display_compositor_.reset(); |
203 gpu_internal_.reset(); | 203 gpu_internal_.reset(); |
204 } | 204 } |
205 | 205 |
206 void GpuMain::TearDownOnGpuThread() { | 206 void GpuMain::TearDownOnGpuThread() { |
(...skipping 24 matching lines...) Expand all Loading... |
231 // TODO(sad): https://crbug.com/645602 | 231 // TODO(sad): https://crbug.com/645602 |
232 } | 232 } |
233 | 233 |
234 bool GpuMain::EnsureSandboxInitialized( | 234 bool GpuMain::EnsureSandboxInitialized( |
235 gpu::GpuWatchdogThread* watchdog_thread) { | 235 gpu::GpuWatchdogThread* watchdog_thread) { |
236 // TODO(sad): https://crbug.com/645602 | 236 // TODO(sad): https://crbug.com/645602 |
237 return true; | 237 return true; |
238 } | 238 } |
239 | 239 |
240 } // namespace ui | 240 } // namespace ui |
OLD | NEW |