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

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: 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 disabled_extensions_ = 576 std::vector<std::string> disabled_vec;
577 base::JoinString(gpu_driver_bug_list_->GetDisabledExtensions(), " "); 577
578 const base::CommandLine* command_line =
579 base::CommandLine::ForCurrentProcess();
580 if (command_line) {
581 disabled_vec = base::SplitString(
582 command_line->GetSwitchValueASCII(switches::kDisableGLExtensions),
583 ", ;",
584 base::KEEP_WHITESPACE,
585 base::SPLIT_WANT_NONEMPTY);
586 }
587 const std::vector<std::string>& disabled_driver_bug_exts =
588 gpu_driver_bug_list_->GetDisabledExtensions();
589 disabled_vec.insert(disabled_vec.end(),
Zhenyao Mo 2015/12/03 23:28:10 Here you may insert the same extension twice if it
David Yen 2015/12/04 00:10:53 Done.
590 disabled_driver_bug_exts.begin(),
591 disabled_driver_bug_exts.end());
592 disabled_extensions_ = base::JoinString(disabled_vec, " ");
578 } 593 }
579 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine( 594 gpu::GpuDriverBugList::AppendWorkaroundsFromCommandLine(
580 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess()); 595 &gpu_driver_bugs_, *base::CommandLine::ForCurrentProcess());
581 596
582 // We have to update GpuFeatureType before notify all the observers. 597 // We have to update GpuFeatureType before notify all the observers.
583 NotifyGpuInfoUpdate(); 598 NotifyGpuInfoUpdate();
584 } 599 }
585 600
586 void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) { 601 void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) {
587 // No further update of gpu_info if falling back to SwiftShader. 602 // 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)) 926 if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_ACCELERATED_VIDEO_DECODE))
912 return true; 927 return true;
913 if (group_name == "Disabled") 928 if (group_name == "Disabled")
914 return true; 929 return true;
915 return false; 930 return false;
916 } 931 }
917 932
918 void GpuDataManagerImplPrivate::GetDisabledExtensions( 933 void GpuDataManagerImplPrivate::GetDisabledExtensions(
919 std::string* disabled_extensions) const { 934 std::string* disabled_extensions) const {
920 DCHECK(disabled_extensions); 935 DCHECK(disabled_extensions);
921
922 *disabled_extensions = disabled_extensions_; 936 *disabled_extensions = disabled_extensions_;
923 } 937 }
924 938
925 void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs( 939 void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs(
926 const GURL& url, GpuDataManagerImpl::DomainGuilt guilt) { 940 const GURL& url, GpuDataManagerImpl::DomainGuilt guilt) {
927 BlockDomainFrom3DAPIsAtTime(url, guilt, base::Time::Now()); 941 BlockDomainFrom3DAPIsAtTime(url, guilt, base::Time::Now());
928 } 942 }
929 943
930 bool GpuDataManagerImplPrivate::Are3DAPIsBlocked(const GURL& top_origin_url, 944 bool GpuDataManagerImplPrivate::Are3DAPIsBlocked(const GURL& top_origin_url,
931 int render_process_id, 945 int render_process_id,
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; 1220 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure;
1207 #if defined(OS_WIN) 1221 #if defined(OS_WIN)
1208 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; 1222 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure;
1209 #endif 1223 #endif
1210 complete_gpu_info_already_requested_ = true; 1224 complete_gpu_info_already_requested_ = true;
1211 // Some observers might be waiting. 1225 // Some observers might be waiting.
1212 NotifyGpuInfoUpdate(); 1226 NotifyGpuInfoUpdate();
1213 } 1227 }
1214 1228
1215 } // namespace content 1229 } // 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