Chromium Code Reviews| 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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "gpu/command_buffer/common/activity_flags.h" | |
| 10 #include "gpu/ipc/common/gpu_memory_buffer_support.h" | 11 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
| 11 #include "gpu/ipc/gpu_in_process_thread_service.h" | 12 #include "gpu/ipc/gpu_in_process_thread_service.h" |
| 12 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" | 13 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
| 13 #include "gpu/ipc/service/gpu_watchdog_thread.h" | 14 #include "gpu/ipc/service/gpu_watchdog_thread.h" |
| 14 #include "services/ui/common/server_gpu_memory_buffer_manager.h" | 15 #include "services/ui/common/server_gpu_memory_buffer_manager.h" |
| 15 #include "services/ui/gpu/gpu_service.h" | 16 #include "services/ui/gpu/gpu_service.h" |
| 16 | 17 |
| 17 #if defined(USE_OZONE) | 18 #if defined(USE_OZONE) |
| 18 #include "ui/ozone/public/ozone_platform.h" | 19 #include "ui/ozone/public/ozone_platform.h" |
| 19 #endif | 20 #endif |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 // |this| will outlive the gpu thread and so it's safe to use | 112 // |this| will outlive the gpu thread and so it's safe to use |
| 112 // base::Unretained here. | 113 // base::Unretained here. |
| 113 gpu_thread_task_runner_->PostTask( | 114 gpu_thread_task_runner_->PostTask( |
| 114 FROM_HERE, | 115 FROM_HERE, |
| 115 base::Bind(&GpuMain::InitOnGpuThread, base::Unretained(this), | 116 base::Bind(&GpuMain::InitOnGpuThread, base::Unretained(this), |
| 116 io_thread_.task_runner(), compositor_thread_task_runner_)); | 117 io_thread_.task_runner(), compositor_thread_task_runner_)); |
| 117 } | 118 } |
| 118 | 119 |
| 119 void GpuMain::CreateGpuService(mojom::GpuServiceRequest request, | 120 void GpuMain::CreateGpuService(mojom::GpuServiceRequest request, |
| 120 mojom::GpuHostPtr gpu_host, | 121 mojom::GpuHostPtr gpu_host, |
| 121 const gpu::GpuPreferences& preferences) { | 122 const gpu::GpuPreferences& preferences, |
| 123 mojo::ScopedSharedBufferHandle activity_flags) { | |
| 124 gpu::GpuProcessActivityFlags::InitializeInstance(std::move(activity_flags)); | |
|
sadrul
2017/03/16 04:40:32
Note that GpuChannelManager is not created in the
ericrk
2017/03/16 21:25:23
Seems like it shouldn't matter where this is initi
| |
| 125 | |
| 122 // |this| will outlive the gpu thread and so it's safe to use | 126 // |this| will outlive the gpu thread and so it's safe to use |
| 123 // base::Unretained here. | 127 // base::Unretained here. |
| 124 gpu_thread_task_runner_->PostTask( | 128 gpu_thread_task_runner_->PostTask( |
| 125 FROM_HERE, | 129 FROM_HERE, |
| 126 base::Bind(&GpuMain::CreateGpuServiceOnGpuThread, base::Unretained(this), | 130 base::Bind(&GpuMain::CreateGpuServiceOnGpuThread, base::Unretained(this), |
| 127 base::Passed(std::move(request)), | 131 base::Passed(std::move(request)), |
| 128 base::Passed(gpu_host.PassInterface()), preferences)); | 132 base::Passed(gpu_host.PassInterface()), preferences)); |
| 129 } | 133 } |
| 130 | 134 |
| 131 void GpuMain::CreateDisplayCompositor( | 135 void GpuMain::CreateDisplayCompositor( |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 // TODO(sad): https://crbug.com/645602 | 252 // TODO(sad): https://crbug.com/645602 |
| 249 } | 253 } |
| 250 | 254 |
| 251 bool GpuMain::EnsureSandboxInitialized( | 255 bool GpuMain::EnsureSandboxInitialized( |
| 252 gpu::GpuWatchdogThread* watchdog_thread) { | 256 gpu::GpuWatchdogThread* watchdog_thread) { |
| 253 // TODO(sad): https://crbug.com/645602 | 257 // TODO(sad): https://crbug.com/645602 |
| 254 return true; | 258 return true; |
| 255 } | 259 } |
| 256 | 260 |
| 257 } // namespace ui | 261 } // namespace ui |
| OLD | NEW |