| 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 "base/power_monitor/power_monitor_device_source.h" | 10 #include "base/power_monitor/power_monitor_device_source.h" |
| 11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "components/viz/common/server_gpu_memory_buffer_manager.h" |
| 12 #include "components/viz/service/display_compositor/gpu_display_provider.h" | 13 #include "components/viz/service/display_compositor/gpu_display_provider.h" |
| 13 #include "components/viz/service/frame_sinks/mojo_frame_sink_manager.h" | 14 #include "components/viz/service/frame_sinks/mojo_frame_sink_manager.h" |
| 14 #include "gpu/command_buffer/common/activity_flags.h" | 15 #include "gpu/command_buffer/common/activity_flags.h" |
| 15 #include "gpu/ipc/common/gpu_memory_buffer_support.h" | 16 #include "gpu/ipc/common/gpu_memory_buffer_support.h" |
| 16 #include "gpu/ipc/gpu_in_process_thread_service.h" | 17 #include "gpu/ipc/gpu_in_process_thread_service.h" |
| 17 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" | 18 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
| 18 #include "gpu/ipc/service/gpu_watchdog_thread.h" | 19 #include "gpu/ipc/service/gpu_watchdog_thread.h" |
| 19 #include "services/ui/common/server_gpu_memory_buffer_manager.h" | |
| 20 #include "services/ui/gpu/gpu_service.h" | 20 #include "services/ui/gpu/gpu_service.h" |
| 21 | 21 |
| 22 #if defined(USE_OZONE) | 22 #if defined(USE_OZONE) |
| 23 #include "ui/ozone/public/ozone_platform.h" | 23 #include "ui/ozone/public/ozone_platform.h" |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
| 27 #include "base/message_loop/message_pump_mac.h" | 27 #include "base/message_loop/message_pump_mac.h" |
| 28 #endif | 28 #endif |
| 29 | 29 |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 cc::mojom::FrameSinkManagerRequest request, | 195 cc::mojom::FrameSinkManagerRequest request, |
| 196 cc::mojom::FrameSinkManagerClientPtrInfo client_info) { | 196 cc::mojom::FrameSinkManagerClientPtrInfo client_info) { |
| 197 DCHECK(!frame_sink_manager_); | 197 DCHECK(!frame_sink_manager_); |
| 198 cc::mojom::FrameSinkManagerClientPtr client; | 198 cc::mojom::FrameSinkManagerClientPtr client; |
| 199 client.Bind(std::move(client_info)); | 199 client.Bind(std::move(client_info)); |
| 200 | 200 |
| 201 gpu_internal_.Bind(std::move(gpu_service_info)); | 201 gpu_internal_.Bind(std::move(gpu_service_info)); |
| 202 | 202 |
| 203 display_provider_ = base::MakeUnique<viz::GpuDisplayProvider>( | 203 display_provider_ = base::MakeUnique<viz::GpuDisplayProvider>( |
| 204 gpu_command_service_, | 204 gpu_command_service_, |
| 205 base::MakeUnique<ServerGpuMemoryBufferManager>(gpu_internal_.get(), | 205 base::MakeUnique<viz::ServerGpuMemoryBufferManager>(gpu_internal_.get(), |
| 206 1 /* client_id */), | 206 1 /* client_id */), |
| 207 image_factory); | 207 image_factory); |
| 208 | 208 |
| 209 frame_sink_manager_ = base::MakeUnique<viz::MojoFrameSinkManager>( | 209 frame_sink_manager_ = base::MakeUnique<viz::MojoFrameSinkManager>( |
| 210 true, display_provider_.get()); | 210 true, display_provider_.get()); |
| 211 frame_sink_manager_->BindPtrAndSetClient(std::move(request), | 211 frame_sink_manager_->BindPtrAndSetClient(std::move(request), |
| 212 std::move(client)); | 212 std::move(client)); |
| 213 } | 213 } |
| 214 | 214 |
| 215 void GpuMain::TearDownOnCompositorThread() { | 215 void GpuMain::TearDownOnCompositorThread() { |
| 216 frame_sink_manager_.reset(); | 216 frame_sink_manager_.reset(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 // TODO(sad): https://crbug.com/645602 | 250 // TODO(sad): https://crbug.com/645602 |
| 251 } | 251 } |
| 252 | 252 |
| 253 bool GpuMain::EnsureSandboxInitialized( | 253 bool GpuMain::EnsureSandboxInitialized( |
| 254 gpu::GpuWatchdogThread* watchdog_thread) { | 254 gpu::GpuWatchdogThread* watchdog_thread) { |
| 255 // TODO(sad): https://crbug.com/645602 | 255 // TODO(sad): https://crbug.com/645602 |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace ui | 259 } // namespace ui |
| OLD | NEW |