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