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 "content/browser/gpu/gpu_data_manager_impl.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl.h" |
6 | 6 |
7 #if defined(OS_MACOSX) | 7 #if defined(OS_MACOSX) |
8 #include <ApplicationServices/ApplicationServices.h> | 8 #include <ApplicationServices/ApplicationServices.h> |
9 #endif // OS_MACOSX | 9 #endif // OS_MACOSX |
10 | 10 |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 if (!gpu_info_.gpu_accessible) | 292 if (!gpu_info_.gpu_accessible) |
293 return false; | 293 return false; |
294 | 294 |
295 if (card_blacklisted_) | 295 if (card_blacklisted_) |
296 return false; | 296 return false; |
297 | 297 |
298 // We only need to block GPU process if more features are disallowed other | 298 // We only need to block GPU process if more features are disallowed other |
299 // than those in the preliminary gpu feature flags because the latter work | 299 // than those in the preliminary gpu feature flags because the latter work |
300 // through renderer commandline switches. | 300 // through renderer commandline switches. |
301 uint32 mask = ~(preliminary_gpu_feature_type_); | 301 uint32 mask = ~(preliminary_gpu_feature_type_); |
302 return (gpu_feature_type_ & mask) == 0; | 302 if ((gpu_feature_type_ & mask) != 0) |
Ken Russell (switch to Gerrit)
2012/10/09 18:52:55
At some point we really should rename confusingly
Zhenyao Mo
2012/10/09 19:20:47
Will do in a follow-up CL.
| |
303 return false; | |
304 | |
305 if (gpu_feature_type_ == content::GPU_FEATURE_TYPE_ALL) { | |
306 if (gpu_blacklist_.get() && !gpu_blacklist_->needs_more_info()) | |
307 return false; | |
308 } | |
309 | |
310 return true; | |
303 } | 311 } |
304 | 312 |
305 void GpuDataManagerImpl::HandleGpuSwitch() { | 313 void GpuDataManagerImpl::HandleGpuSwitch() { |
306 if (complete_gpu_info_already_requested_) { | 314 if (complete_gpu_info_already_requested_) { |
307 complete_gpu_info_already_requested_ = false; | 315 complete_gpu_info_already_requested_ = false; |
308 gpu_info_.finalized = false; | 316 gpu_info_.finalized = false; |
309 RequestCompleteGpuInfoIfNeeded(); | 317 RequestCompleteGpuInfoIfNeeded(); |
310 } | 318 } |
311 } | 319 } |
312 | 320 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
404 switches::kGpuSwitchingOptionNameForceIntegrated); | 412 switches::kGpuSwitchingOptionNameForceIntegrated); |
405 break; | 413 break; |
406 case content::GPU_SWITCHING_OPTION_AUTOMATIC: | 414 case content::GPU_SWITCHING_OPTION_AUTOMATIC: |
407 case content::GPU_SWITCHING_OPTION_UNKNOWN: | 415 case content::GPU_SWITCHING_OPTION_UNKNOWN: |
408 break; | 416 break; |
409 } | 417 } |
410 } else { | 418 } else { |
411 command_line->AppendSwitchASCII(switches::kSupportsDualGpus, "false"); | 419 command_line->AppendSwitchASCII(switches::kSupportsDualGpus, "false"); |
412 } | 420 } |
413 | 421 |
422 if (!gpu_blacklist_.get() || !gpu_blacklist_->needs_more_info()) | |
423 command_line->AppendSwitch(switches::kSkipGpuFullInfoCollection); | |
424 | |
414 if (!swiftshader_path.empty()) | 425 if (!swiftshader_path.empty()) |
415 command_line->AppendSwitchPath(switches::kSwiftShaderPath, | 426 command_line->AppendSwitchPath(switches::kSwiftShaderPath, |
416 swiftshader_path); | 427 swiftshader_path); |
417 | 428 |
418 { | 429 { |
419 base::AutoLock auto_lock(gpu_info_lock_); | 430 base::AutoLock auto_lock(gpu_info_lock_); |
420 if (gpu_info_.optimus) | 431 if (gpu_info_.optimus) |
421 command_line->AppendSwitch(switches::kReduceGpuSandbox); | 432 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
422 if (gpu_info_.amd_switchable) { | 433 if (gpu_info_.amd_switchable) { |
423 // The image transport surface currently doesn't work with AMD Dynamic | 434 // The image transport surface currently doesn't work with AMD Dynamic |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
559 } | 570 } |
560 | 571 |
561 void GpuDataManagerImpl::BlacklistCard() { | 572 void GpuDataManagerImpl::BlacklistCard() { |
562 card_blacklisted_ = true; | 573 card_blacklisted_ = true; |
563 | 574 |
564 gpu_feature_type_ = content::GPU_FEATURE_TYPE_ALL; | 575 gpu_feature_type_ = content::GPU_FEATURE_TYPE_ALL; |
565 | 576 |
566 EnableSoftwareRenderingIfNecessary(); | 577 EnableSoftwareRenderingIfNecessary(); |
567 NotifyGpuInfoUpdate(); | 578 NotifyGpuInfoUpdate(); |
568 } | 579 } |
OLD | NEW |