OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 command_line->GetSwitchValueASCII(switches::kGpuTestingOsVersion); | 607 command_line->GetSwitchValueASCII(switches::kGpuTestingOsVersion); |
608 | 608 |
609 if (gpu_blacklist_) { | 609 if (gpu_blacklist_) { |
610 std::set<int> features = gpu_blacklist_->MakeDecision( | 610 std::set<int> features = gpu_blacklist_->MakeDecision( |
611 gpu::GpuControlList::kOsAny, os_version, gpu_info_); | 611 gpu::GpuControlList::kOsAny, os_version, gpu_info_); |
612 if (update_histograms_) | 612 if (update_histograms_) |
613 UpdateStats(gpu_info_, gpu_blacklist_.get(), features); | 613 UpdateStats(gpu_info_, gpu_blacklist_.get(), features); |
614 | 614 |
615 UpdateBlacklistedFeatures(features); | 615 UpdateBlacklistedFeatures(features); |
616 } | 616 } |
| 617 |
| 618 std::set<std::string> disabled_ext_set; |
| 619 |
| 620 // Merge disabled extensions from the command line with gpu driver bug list. |
| 621 if (command_line) { |
| 622 const std::vector<std::string>& disabled_command_line_exts = |
| 623 base::SplitString( |
| 624 command_line->GetSwitchValueASCII(switches::kDisableGLExtensions), |
| 625 ", ;", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
| 626 disabled_ext_set.insert(disabled_command_line_exts.begin(), |
| 627 disabled_command_line_exts.end()); |
| 628 } |
| 629 |
617 if (gpu_driver_bug_list_) { | 630 if (gpu_driver_bug_list_) { |
618 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( | 631 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( |
619 gpu::GpuControlList::kOsAny, os_version, gpu_info_); | 632 gpu::GpuControlList::kOsAny, os_version, gpu_info_); |
620 | 633 |
621 std::set<std::string> disabled_ext_set; | |
622 | |
623 // Merge disabled extensions from the command line with gpu driver bug list. | |
624 if (command_line) { | |
625 const std::vector<std::string>& disabled_command_line_exts = | |
626 base::SplitString( | |
627 command_line->GetSwitchValueASCII(switches::kDisableGLExtensions), | |
628 ", ;", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); | |
629 disabled_ext_set.insert(disabled_command_line_exts.begin(), | |
630 disabled_command_line_exts.end()); | |
631 } | |
632 const std::vector<std::string>& disabled_driver_bug_exts = | 634 const std::vector<std::string>& disabled_driver_bug_exts = |
633 gpu_driver_bug_list_->GetDisabledExtensions(); | 635 gpu_driver_bug_list_->GetDisabledExtensions(); |
634 disabled_ext_set.insert(disabled_driver_bug_exts.begin(), | 636 disabled_ext_set.insert(disabled_driver_bug_exts.begin(), |
635 disabled_driver_bug_exts.end()); | 637 disabled_driver_bug_exts.end()); |
636 disabled_extensions_ = | |
637 base::JoinString(std::vector<std::string>(disabled_ext_set.begin(), | |
638 disabled_ext_set.end()), | |
639 " "); | |
640 } | 638 } |
| 639 disabled_extensions_ = |
| 640 base::JoinString(std::vector<std::string>(disabled_ext_set.begin(), |
| 641 disabled_ext_set.end()), |
| 642 " "); |
| 643 |
641 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 644 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
642 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); | 645 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); |
643 | 646 |
644 // We have to update GpuFeatureType before notify all the observers. | 647 // We have to update GpuFeatureType before notify all the observers. |
645 NotifyGpuInfoUpdate(); | 648 NotifyGpuInfoUpdate(); |
646 } | 649 } |
647 | 650 |
648 void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { | 651 void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { |
649 // No further update of gpu_info if falling back to SwiftShader. | 652 // No further update of gpu_info if falling back to SwiftShader. |
650 if (use_swiftshader_) | 653 if (use_swiftshader_) |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1302 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1300 #if defined(OS_WIN) | 1303 #if defined(OS_WIN) |
1301 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1304 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1302 #endif | 1305 #endif |
1303 complete_gpu_info_already_requested_ = true; | 1306 complete_gpu_info_already_requested_ = true; |
1304 // Some observers might be waiting. | 1307 // Some observers might be waiting. |
1305 NotifyGpuInfoUpdate(); | 1308 NotifyGpuInfoUpdate(); |
1306 } | 1309 } |
1307 | 1310 |
1308 } // namespace content | 1311 } // namespace content |
OLD | NEW |