| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdlib.h> | 6 #include <stdlib.h> |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 #if defined(OS_MACOSX) | 74 #if defined(OS_MACOSX) |
| 75 #include "base/message_loop/message_pump_mac.h" | 75 #include "base/message_loop/message_pump_mac.h" |
| 76 #include "content/common/sandbox_mac.h" | 76 #include "content/common/sandbox_mac.h" |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 79 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 80 #include "content/common/gpu/media/vaapi_wrapper.h" | 80 #include "content/common/gpu/media/vaapi_wrapper.h" |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 #if defined(ENABLE_VULKAN) | |
| 84 #include "gpu/vulkan/vulkan_surface.h" | |
| 85 #endif | |
| 86 | |
| 87 #if defined(SANITIZER_COVERAGE) | 83 #if defined(SANITIZER_COVERAGE) |
| 88 #include <sanitizer/common_interface_defs.h> | 84 #include <sanitizer/common_interface_defs.h> |
| 89 #include <sanitizer/coverage_interface.h> | 85 #include <sanitizer/coverage_interface.h> |
| 90 #endif | 86 #endif |
| 91 | 87 |
| 92 #if defined(CYGPROFILE_INSTRUMENTATION) | 88 #if defined(CYGPROFILE_INSTRUMENTATION) |
| 93 const int kGpuTimeout = 30000; | 89 const int kGpuTimeout = 30000; |
| 94 #else | 90 #else |
| 95 const int kGpuTimeout = 10000; | 91 const int kGpuTimeout = 10000; |
| 96 #endif | 92 #endif |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // is called from the sandbox warmup code before getting here. | 281 // is called from the sandbox warmup code before getting here. |
| 286 gl_already_initialized = true; | 282 gl_already_initialized = true; |
| 287 } | 283 } |
| 288 #endif | 284 #endif |
| 289 if (command_line.HasSwitch(switches::kInProcessGPU)) { | 285 if (command_line.HasSwitch(switches::kInProcessGPU)) { |
| 290 // With in-process GPU, GLSurface::InitializeOneOff() is called from | 286 // With in-process GPU, GLSurface::InitializeOneOff() is called from |
| 291 // GpuChildThread before getting here. | 287 // GpuChildThread before getting here. |
| 292 gl_already_initialized = true; | 288 gl_already_initialized = true; |
| 293 } | 289 } |
| 294 | 290 |
| 295 #if defined(ENABLE_VULKAN) | |
| 296 // Temporary Vulkan initialization injection. | |
| 297 gpu::VulkanSurface::InitializeOneOff(); | |
| 298 #endif | |
| 299 | |
| 300 // Load and initialize the GL implementation and locate the GL entry points. | 291 // Load and initialize the GL implementation and locate the GL entry points. |
| 301 bool gl_initialized = | 292 bool gl_initialized = |
| 302 gl_already_initialized | 293 gl_already_initialized |
| 303 ? gfx::GetGLImplementation() != gfx::kGLImplementationNone | 294 ? gfx::GetGLImplementation() != gfx::kGLImplementationNone |
| 304 : gfx::GLSurface::InitializeOneOff(); | 295 : gfx::GLSurface::InitializeOneOff(); |
| 305 if (gl_initialized) { | 296 if (gl_initialized) { |
| 306 // We need to collect GL strings (VENDOR, RENDERER) for blacklisting | 297 // We need to collect GL strings (VENDOR, RENDERER) for blacklisting |
| 307 // purposes. However, on Mac we don't actually use them. As documented in | 298 // purposes. However, on Mac we don't actually use them. As documented in |
| 308 // crbug.com/222934, due to some driver issues, glGetString could take | 299 // crbug.com/222934, due to some driver issues, glGetString could take |
| 309 // multiple seconds to finish, which in turn cause the GPU process to | 300 // multiple seconds to finish, which in turn cause the GPU process to |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 return true; | 593 return true; |
| 603 } | 594 } |
| 604 | 595 |
| 605 return false; | 596 return false; |
| 606 } | 597 } |
| 607 #endif // defined(OS_WIN) | 598 #endif // defined(OS_WIN) |
| 608 | 599 |
| 609 } // namespace. | 600 } // namespace. |
| 610 | 601 |
| 611 } // namespace content | 602 } // namespace content |
| OLD | NEW |