OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/gpu/gpu_child_thread.h" | 5 #include "content/gpu/gpu_child_thread.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "ipc/ipc_sync_message_filter.h" | 31 #include "ipc/ipc_sync_message_filter.h" |
32 #include "ui/gl/gl_implementation.h" | 32 #include "ui/gl/gl_implementation.h" |
33 #include "ui/gl/gl_switches.h" | 33 #include "ui/gl/gl_switches.h" |
34 #include "ui/gl/gpu_switching_manager.h" | 34 #include "ui/gl/gpu_switching_manager.h" |
35 | 35 |
36 #if defined(USE_OZONE) | 36 #if defined(USE_OZONE) |
37 #include "ui/ozone/public/gpu_platform_support.h" | 37 #include "ui/ozone/public/gpu_platform_support.h" |
38 #include "ui/ozone/public/ozone_platform.h" | 38 #include "ui/ozone/public/ozone_platform.h" |
39 #endif | 39 #endif |
40 | 40 |
| 41 #if defined(ENABLE_VULKAN) |
| 42 #include "gpu/vulkan/vulkan_surface.h" |
| 43 #endif |
| 44 |
41 namespace content { | 45 namespace content { |
42 namespace { | 46 namespace { |
43 | 47 |
44 static base::LazyInstance<scoped_refptr<ThreadSafeSender> > | 48 static base::LazyInstance<scoped_refptr<ThreadSafeSender> > |
45 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER; | 49 g_thread_safe_sender = LAZY_INSTANCE_INITIALIZER; |
46 | 50 |
47 bool GetSizeTFromSwitch(const base::CommandLine* command_line, | 51 bool GetSizeTFromSwitch(const base::CommandLine* command_line, |
48 const base::StringPiece& switch_string, | 52 const base::StringPiece& switch_string, |
49 size_t* value) { | 53 size_t* value) { |
50 if (!command_line->HasSwitch(switch_string)) | 54 if (!command_line->HasSwitch(switch_string)) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 195 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
192 switches::kSingleProcess) || | 196 switches::kSingleProcess) || |
193 base::CommandLine::ForCurrentProcess()->HasSwitch( | 197 base::CommandLine::ForCurrentProcess()->HasSwitch( |
194 switches::kInProcessGPU)); | 198 switches::kInProcessGPU)); |
195 | 199 |
196 // Populate accelerator capabilities (normally done during GpuMain, which is | 200 // Populate accelerator capabilities (normally done during GpuMain, which is |
197 // not called for single process or in process gpu). | 201 // not called for single process or in process gpu). |
198 gpu_info_.video_decode_accelerator_capabilities = | 202 gpu_info_.video_decode_accelerator_capabilities = |
199 content::GpuVideoDecodeAccelerator::GetCapabilities(); | 203 content::GpuVideoDecodeAccelerator::GetCapabilities(); |
200 | 204 |
| 205 #if defined(ENABLE_VULKAN) |
| 206 // Temporary Vulkan initialization injection. |
| 207 gfx::VulkanSurface::InitializeOneOff(); |
| 208 #endif |
| 209 |
201 if (!gfx::GLSurface::InitializeOneOff()) | 210 if (!gfx::GLSurface::InitializeOneOff()) |
202 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed"; | 211 VLOG(1) << "gfx::GLSurface::InitializeOneOff failed"; |
203 | 212 |
204 g_thread_safe_sender.Get() = thread_safe_sender(); | 213 g_thread_safe_sender.Get() = thread_safe_sender(); |
205 } | 214 } |
206 | 215 |
207 GpuChildThread::~GpuChildThread() { | 216 GpuChildThread::~GpuChildThread() { |
208 while (!deferred_messages_.empty()) { | 217 while (!deferred_messages_.empty()) { |
209 delete deferred_messages_.front(); | 218 delete deferred_messages_.front(); |
210 deferred_messages_.pop(); | 219 deferred_messages_.pop(); |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 | 616 |
608 void GpuChildThread::BindProcessControlRequest( | 617 void GpuChildThread::BindProcessControlRequest( |
609 mojo::InterfaceRequest<ProcessControl> request) { | 618 mojo::InterfaceRequest<ProcessControl> request) { |
610 DVLOG(1) << "GPU: Binding ProcessControl request"; | 619 DVLOG(1) << "GPU: Binding ProcessControl request"; |
611 DCHECK(process_control_); | 620 DCHECK(process_control_); |
612 process_control_bindings_.AddBinding(process_control_.get(), | 621 process_control_bindings_.AddBinding(process_control_.get(), |
613 std::move(request)); | 622 std::move(request)); |
614 } | 623 } |
615 | 624 |
616 } // namespace content | 625 } // namespace content |
OLD | NEW |