| 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif | 10 #endif |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 // crash. | 285 // crash. |
| 286 // By skipping the following code on Mac, we don't really lose anything, | 286 // By skipping the following code on Mac, we don't really lose anything, |
| 287 // because the basic GPU information is passed down from browser process | 287 // because the basic GPU information is passed down from browser process |
| 288 // and we already registered them through SetGpuInfo() above. | 288 // and we already registered them through SetGpuInfo() above. |
| 289 base::TimeTicks before_collect_context_graphics_info = | 289 base::TimeTicks before_collect_context_graphics_info = |
| 290 base::TimeTicks::Now(); | 290 base::TimeTicks::Now(); |
| 291 #if !defined(OS_MACOSX) | 291 #if !defined(OS_MACOSX) |
| 292 if (!CollectGraphicsInfo(gpu_info)) | 292 if (!CollectGraphicsInfo(gpu_info)) |
| 293 dead_on_arrival = true; | 293 dead_on_arrival = true; |
| 294 | 294 |
| 295 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 295 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) || defined(OS_LINUX) |
| 296 // Recompute gpu driver bug workarounds - this is specifically useful | 296 // Recompute gpu driver bug workarounds. |
| 297 // on systems where vendor_id/device_id aren't available. | 297 // This is necessary on systems where vendor_id/device_id aren't available |
| 298 // (Chrome OS, Android) or where workarounds may be dependent on GL_VENDOR |
| 299 // and GL_RENDERER strings which are lazily computed (Linux). |
| 298 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 300 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
| 299 gpu::ApplyGpuDriverBugWorkarounds( | 301 gpu::ApplyGpuDriverBugWorkarounds( |
| 300 gpu_info, const_cast<base::CommandLine*>(&command_line)); | 302 gpu_info, const_cast<base::CommandLine*>(&command_line)); |
| 301 } | 303 } |
| 302 #endif | 304 #endif |
| 303 | 305 |
| 304 #if defined(OS_LINUX) | 306 #if defined(OS_LINUX) |
| 305 initialized_gl_context = true; | 307 initialized_gl_context = true; |
| 306 #if !defined(OS_CHROMEOS) | 308 #if !defined(OS_CHROMEOS) |
| 307 if (gpu_info.gpu.vendor_id == 0x10de && // NVIDIA | 309 if (gpu_info.gpu.vendor_id == 0x10de && // NVIDIA |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 return true; | 561 return true; |
| 560 } | 562 } |
| 561 | 563 |
| 562 return false; | 564 return false; |
| 563 } | 565 } |
| 564 #endif // defined(OS_WIN) | 566 #endif // defined(OS_WIN) |
| 565 | 567 |
| 566 } // namespace. | 568 } // namespace. |
| 567 | 569 |
| 568 } // namespace content | 570 } // namespace content |
| OLD | NEW |