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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 // purposes. However, on Mac we don't actually use them. As documented in | 243 // purposes. However, on Mac we don't actually use them. As documented in |
244 // crbug.com/222934, due to some driver issues, glGetString could take | 244 // crbug.com/222934, due to some driver issues, glGetString could take |
245 // multiple seconds to finish, which in turn cause the GPU process to | 245 // multiple seconds to finish, which in turn cause the GPU process to |
246 // crash. | 246 // crash. |
247 // By skipping the following code on Mac, we don't really lose anything, | 247 // By skipping the following code on Mac, we don't really lose anything, |
248 // because the basic GPU information is passed down from browser process | 248 // because the basic GPU information is passed down from browser process |
249 // and we already registered them through SetGpuInfo() above. | 249 // and we already registered them through SetGpuInfo() above. |
250 base::TimeTicks before_collect_context_graphics_info = | 250 base::TimeTicks before_collect_context_graphics_info = |
251 base::TimeTicks::Now(); | 251 base::TimeTicks::Now(); |
252 #if !defined(OS_MACOSX) | 252 #if !defined(OS_MACOSX) |
253 if (!gpu::CollectContextGraphicsInfo(&gpu_info)) | 253 gpu::CollectInfoResult result = |
254 VLOG(1) << "gpu::CollectGraphicsInfo failed"; | 254 gpu::CollectContextGraphicsInfo(&gpu_info); |
| 255 switch (result) { |
| 256 case gpu::kCollectInfoFatalFailure: |
| 257 LOG(ERROR) << "gpu::CollectGraphicsInfo failed (fatal)."; |
| 258 dead_on_arrival = true; |
| 259 break; |
| 260 case gpu::kCollectInfoNonFatalFailure: |
| 261 VLOG(1) << "gpu::CollectGraphicsInfo failed (non-fatal)."; |
| 262 break; |
| 263 case gpu::kCollectInfoSuccess: |
| 264 break; |
| 265 } |
255 GetContentClient()->SetGpuInfo(gpu_info); | 266 GetContentClient()->SetGpuInfo(gpu_info); |
256 | 267 |
257 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) | 268 #if defined(OS_CHROMEOS) || defined(OS_ANDROID) |
258 // Recompute gpu driver bug workarounds - this is specifically useful | 269 // Recompute gpu driver bug workarounds - this is specifically useful |
259 // on systems where vendor_id/device_id aren't available. | 270 // on systems where vendor_id/device_id aren't available. |
260 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { | 271 if (!command_line.HasSwitch(switches::kDisableGpuDriverBugWorkarounds)) { |
261 gpu::ApplyGpuDriverBugWorkarounds( | 272 gpu::ApplyGpuDriverBugWorkarounds( |
262 gpu_info, const_cast<CommandLine*>(&command_line)); | 273 gpu_info, const_cast<CommandLine*>(&command_line)); |
263 } | 274 } |
264 #endif | 275 #endif |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 return true; | 449 return true; |
439 } | 450 } |
440 | 451 |
441 return false; | 452 return false; |
442 } | 453 } |
443 #endif // defined(OS_WIN) | 454 #endif // defined(OS_WIN) |
444 | 455 |
445 } // namespace. | 456 } // namespace. |
446 | 457 |
447 } // namespace content | 458 } // namespace content |
OLD | NEW |