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