| 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 <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 81 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 82 #include "media/gpu/vaapi_wrapper.h" | 82 #include "media/gpu/vaapi_wrapper.h" |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 #if defined(SANITIZER_COVERAGE) | 85 #if defined(SANITIZER_COVERAGE) |
| 86 #include <sanitizer/common_interface_defs.h> | 86 #include <sanitizer/common_interface_defs.h> |
| 87 #include <sanitizer/coverage_interface.h> | 87 #include <sanitizer/coverage_interface.h> |
| 88 #endif | 88 #endif |
| 89 | 89 |
| 90 #if defined(USE_OZONE) |
| 91 #include "ui/ozone/public/ozone_platform.h" |
| 92 #endif |
| 93 |
| 90 namespace content { | 94 namespace content { |
| 91 | 95 |
| 92 namespace { | 96 namespace { |
| 93 | 97 |
| 94 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info, | 98 void GetGpuInfoFromCommandLine(gpu::GPUInfo& gpu_info, |
| 95 const base::CommandLine& command_line); | 99 const base::CommandLine& command_line); |
| 96 void WarmUpSandbox(); | 100 void WarmUpSandbox(); |
| 97 | 101 |
| 98 #if !defined(OS_MACOSX) | 102 #if !defined(OS_MACOSX) |
| 99 bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info); | 103 bool CollectGraphicsInfo(gpu::GPUInfo& gpu_info); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // On Mac, if the sandbox is enabled, then gl::init::InitializeGLOneOff() | 273 // On Mac, if the sandbox is enabled, then gl::init::InitializeGLOneOff() |
| 270 // is called from the sandbox warmup code before getting here. | 274 // is called from the sandbox warmup code before getting here. |
| 271 gl_already_initialized = true; | 275 gl_already_initialized = true; |
| 272 } | 276 } |
| 273 #endif | 277 #endif |
| 274 if (command_line.HasSwitch(switches::kInProcessGPU)) { | 278 if (command_line.HasSwitch(switches::kInProcessGPU)) { |
| 275 // With in-process GPU, gl::init::InitializeGLOneOff() is called from | 279 // With in-process GPU, gl::init::InitializeGLOneOff() is called from |
| 276 // GpuChildThread before getting here. | 280 // GpuChildThread before getting here. |
| 277 gl_already_initialized = true; | 281 gl_already_initialized = true; |
| 278 } | 282 } |
| 283 #if defined(USE_OZONE) |
| 284 // TODO(fwang): Must plumb the shell::Connector* to here and pass into ozone. |
| 285 ui::OzonePlatform::InitParams ozoneInitParams; |
| 286 ozoneInitParams.single_process = |
| 287 command_line.HasSwitch(switches::kInProcessGPU) || |
| 288 command_line.HasSwitch(switches::kSingleProcess); |
| 289 ui::OzonePlatform::InitializeForGPU(ozoneInitParams); |
| 290 #endif |
| 279 | 291 |
| 280 // Load and initialize the GL implementation and locate the GL entry points. | 292 // Load and initialize the GL implementation and locate the GL entry points. |
| 281 bool gl_initialized = | 293 bool gl_initialized = |
| 282 gl_already_initialized | 294 gl_already_initialized |
| 283 ? gl::GetGLImplementation() != gl::kGLImplementationNone | 295 ? gl::GetGLImplementation() != gl::kGLImplementationNone |
| 284 : gl::init::InitializeGLOneOff(); | 296 : gl::init::InitializeGLOneOff(); |
| 285 if (gl_initialized) { | 297 if (gl_initialized) { |
| 286 // We need to collect GL strings (VENDOR, RENDERER) for blacklisting | 298 // We need to collect GL strings (VENDOR, RENDERER) for blacklisting |
| 287 // purposes. However, on Mac we don't actually use them. As documented in | 299 // purposes. However, on Mac we don't actually use them. As documented in |
| 288 // crbug.com/222934, due to some driver issues, glGetString could take | 300 // crbug.com/222934, due to some driver issues, glGetString could take |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 return true; | 556 return true; |
| 545 } | 557 } |
| 546 | 558 |
| 547 return false; | 559 return false; |
| 548 } | 560 } |
| 549 #endif // defined(OS_WIN) | 561 #endif // defined(OS_WIN) |
| 550 | 562 |
| 551 } // namespace. | 563 } // namespace. |
| 552 | 564 |
| 553 } // namespace content | 565 } // namespace content |
| OLD | NEW |