| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 157 |
| 158 #if !defined(OS_CHROMEOS) | 158 #if !defined(OS_CHROMEOS) |
| 159 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 159 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 160 switches::kWindowDepth)); | 160 switches::kWindowDepth)); |
| 161 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 161 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 162 switches::kX11VisualID)); | 162 switches::kX11VisualID)); |
| 163 #endif | 163 #endif |
| 164 | 164 |
| 165 #endif | 165 #endif |
| 166 | 166 |
| 167 logging::SetLogMessageHandler(GpuProcessLogMessageHandler); | 167 logging::PushLogMessageHandler(GpuProcessLogMessageHandler); |
| 168 | 168 |
| 169 if (command_line.HasSwitch(switches::kSupportsDualGpus)) { | 169 if (command_line.HasSwitch(switches::kSupportsDualGpus)) { |
| 170 std::string types = command_line.GetSwitchValueASCII( | 170 std::string types = command_line.GetSwitchValueASCII( |
| 171 switches::kGpuDriverBugWorkarounds); | 171 switches::kGpuDriverBugWorkarounds); |
| 172 std::set<int> workarounds; | 172 std::set<int> workarounds; |
| 173 gpu::StringToFeatureSet(types, &workarounds); | 173 gpu::StringToFeatureSet(types, &workarounds); |
| 174 if (workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1) | 174 if (workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1) |
| 175 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); | 175 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); |
| 176 else if (workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) | 176 else if (workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) |
| 177 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); | 177 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 376 } |
| 377 #elif defined(OS_WIN) | 377 #elif defined(OS_WIN) |
| 378 gpu_info.sandboxed = StartSandboxWindows(parameters.sandbox_info); | 378 gpu_info.sandboxed = StartSandboxWindows(parameters.sandbox_info); |
| 379 #elif defined(OS_MACOSX) | 379 #elif defined(OS_MACOSX) |
| 380 gpu_info.sandboxed = Sandbox::SandboxIsCurrentlyActive(); | 380 gpu_info.sandboxed = Sandbox::SandboxIsCurrentlyActive(); |
| 381 #endif | 381 #endif |
| 382 } else { | 382 } else { |
| 383 dead_on_arrival = true; | 383 dead_on_arrival = true; |
| 384 } | 384 } |
| 385 | 385 |
| 386 logging::SetLogMessageHandler(NULL); | 386 logging::PopLogMessageHandler(); |
| 387 | 387 |
| 388 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory; | 388 std::unique_ptr<gpu::GpuMemoryBufferFactory> gpu_memory_buffer_factory; |
| 389 if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) | 389 if (gpu::GetNativeGpuMemoryBufferType() != gfx::EMPTY_BUFFER) |
| 390 gpu_memory_buffer_factory = gpu::GpuMemoryBufferFactory::CreateNativeType(); | 390 gpu_memory_buffer_factory = gpu::GpuMemoryBufferFactory::CreateNativeType(); |
| 391 | 391 |
| 392 base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL; | 392 base::ThreadPriority io_thread_priority = base::ThreadPriority::NORMAL; |
| 393 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 393 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 394 io_thread_priority = base::ThreadPriority::DISPLAY; | 394 io_thread_priority = base::ThreadPriority::DISPLAY; |
| 395 #endif | 395 #endif |
| 396 | 396 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 return true; | 618 return true; |
| 619 } | 619 } |
| 620 | 620 |
| 621 return false; | 621 return false; |
| 622 } | 622 } |
| 623 #endif // defined(OS_WIN) | 623 #endif // defined(OS_WIN) |
| 624 | 624 |
| 625 } // namespace. | 625 } // namespace. |
| 626 | 626 |
| 627 } // namespace content | 627 } // namespace content |
| OLD | NEW |