Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 1497863002: Fix disabled extensions for virtual contexts and respect command line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed GL_NUM_EXTENSIONS Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/gl/gl_gl_api_implementation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/gl/gl_gl_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698