Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: services/ui/gpu/gpu_main.cc

Issue 2939953004: viz: Move some code into //components/viz/common. (Closed)
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/display_compositor/gpu_display_provider.h" 12 #include "components/viz/display_compositor/gpu_display_provider.h"
13 #include "components/viz/frame_sinks/mojo_frame_sink_manager.h" 13 #include "components/viz/frame_sinks/mojo_frame_sink_manager.h"
14 #include "components/viz/host/gpu/server_gpu_memory_buffer_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
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_->Connect(std::move(request), std::move(client)); 211 frame_sink_manager_->Connect(std::move(request), std::move(client));
212 } 212 }
213 213
214 void GpuMain::TearDownOnCompositorThread() { 214 void GpuMain::TearDownOnCompositorThread() {
215 frame_sink_manager_.reset(); 215 frame_sink_manager_.reset();
216 display_provider_.reset(); 216 display_provider_.reset();
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 // TODO(sad): https://crbug.com/645602 249 // TODO(sad): https://crbug.com/645602
250 } 250 }
251 251
252 bool GpuMain::EnsureSandboxInitialized( 252 bool GpuMain::EnsureSandboxInitialized(
253 gpu::GpuWatchdogThread* watchdog_thread) { 253 gpu::GpuWatchdogThread* watchdog_thread) {
254 // TODO(sad): https://crbug.com/645602 254 // TODO(sad): https://crbug.com/645602
255 return true; 255 return true;
256 } 256 }
257 257
258 } // namespace ui 258 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698