| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 566 gpu::GpuControlList::kOsAny, std::string(), gpu_info_); | 566 gpu::GpuControlList::kOsAny, std::string(), gpu_info_); |
| 567 if (update_histograms_) | 567 if (update_histograms_) |
| 568 UpdateStats(gpu_info_, gpu_blacklist_.get(), features); | 568 UpdateStats(gpu_info_, gpu_blacklist_.get(), features); |
| 569 | 569 |
| 570 UpdateBlacklistedFeatures(features); | 570 UpdateBlacklistedFeatures(features); |
| 571 } | 571 } |
| 572 if (gpu_driver_bug_list_) { | 572 if (gpu_driver_bug_list_) { |
| 573 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( | 573 gpu_driver_bugs_ = gpu_driver_bug_list_->MakeDecision( |
| 574 gpu::GpuControlList::kOsAny, std::string(), gpu_info_); | 574 gpu::GpuControlList::kOsAny, std::string(), gpu_info_); |
| 575 | 575 |
| 576 std::set<std::string> disabled_ext_set; |
| 577 |
| 578 // Merge disabled extensions from the command line with gpu driver bug list. |
| 579 const base::CommandLine* command_line = |
| 580 base::CommandLine::ForCurrentProcess(); |
| 581 if (command_line) { |
| 582 const std::vector<std::string>& disabled_command_line_exts = |
| 583 base::SplitString( |
| 584 command_line->GetSwitchValueASCII(switches::kDisableGLExtensions), |
| 585 ", ;", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
| 586 disabled_ext_set.insert(disabled_command_line_exts.begin(), |
| 587 disabled_command_line_exts.end()); |
| 588 } |
| 589 const std::vector<std::string>& disabled_driver_bug_exts = |
| 590 gpu_driver_bug_list_->GetDisabledExtensions(); |
| 591 disabled_ext_set.insert(disabled_driver_bug_exts.begin(), |
| 592 disabled_driver_bug_exts.end()); |
| 576 disabled_extensions_ = | 593 disabled_extensions_ = |
| 577 base::JoinString(gpu_driver_bug_list_->GetDisabledExtensions(), " "); | 594 base::JoinString(std::vector<std::string>(disabled_ext_set.begin(), |
| 595 disabled_ext_set.end()), |
| 596 " "); |
| 578 } | 597 } |
| 579 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 598 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
| 580 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); | 599 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); |
| 581 | 600 |
| 582 // We have to update GpuFeatureType before notify all the observers. | 601 // We have to update GpuFeatureType before notify all the observers. |
| 583 NotifyGpuInfoUpdate(); | 602 NotifyGpuInfoUpdate(); |
| 584 } | 603 } |
| 585 | 604 |
| 586 void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { | 605 void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { |
| 587 // No further update of gpu_info if falling back to SwiftShader. | 606 // No further update of gpu_info if falling back to SwiftShader. |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE)) | 930 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE)) |
| 912 return true; | 931 return true; |
| 913 if (group_name == "Disabled") | 932 if (group_name == "Disabled") |
| 914 return true; | 933 return true; |
| 915 return false; | 934 return false; |
| 916 } | 935 } |
| 917 | 936 |
| 918 void GpuDataManagerImplPrivate::GetDisabledExtensions( | 937 void GpuDataManagerImplPrivate::GetDisabledExtensions( |
| 919 std::string* disabled_extensions) const { | 938 std::string* disabled_extensions) const { |
| 920 DCHECK(disabled_extensions); | 939 DCHECK(disabled_extensions); |
| 921 | |
| 922 *disabled_extensions = disabled_extensions_; | 940 *disabled_extensions = disabled_extensions_; |
| 923 } | 941 } |
| 924 | 942 |
| 925 void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs( | 943 void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs( |
| 926 const GURL& url, GpuDataManagerImpl::DomainGuilt guilt) { | 944 const GURL& url, GpuDataManagerImpl::DomainGuilt guilt) { |
| 927 BlockDomainFrom3DAPIsAtTime(url, guilt, base::Time::Now()); | 945 BlockDomainFrom3DAPIsAtTime(url, guilt, base::Time::Now()); |
| 928 } | 946 } |
| 929 | 947 |
| 930 bool GpuDataManagerImplPrivate::Are3DAPIsBlocked(const GURL& top_origin_url, | 948 bool GpuDataManagerImplPrivate::Are3DAPIsBlocked(const GURL& top_origin_url, |
| 931 int render_process_id, | 949 int render_process_id, |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1224 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
| 1207 #if defined(OS_WIN) | 1225 #if defined(OS_WIN) |
| 1208 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1226 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
| 1209 #endif | 1227 #endif |
| 1210 complete_gpu_info_already_requested_ = true; | 1228 complete_gpu_info_already_requested_ = true; |
| 1211 // Some observers might be waiting. | 1229 // Some observers might be waiting. |
| 1212 NotifyGpuInfoUpdate(); | 1230 NotifyGpuInfoUpdate(); |
| 1213 } | 1231 } |
| 1214 | 1232 |
| 1215 } // namespace content | 1233 } // namespace content |
| OLD | NEW |