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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 void GpuDataManagerImplPrivate::SetDisplayCount(unsigned int display_count) { | 295 void GpuDataManagerImplPrivate::SetDisplayCount(unsigned int display_count) { |
296 display_count_ = display_count; | 296 display_count_ = display_count; |
297 } | 297 } |
298 | 298 |
299 unsigned int GpuDataManagerImplPrivate::GetDisplayCount() const { | 299 unsigned int GpuDataManagerImplPrivate::GetDisplayCount() const { |
300 return display_count_; | 300 return display_count_; |
301 } | 301 } |
302 | 302 |
303 gpu::GPUInfo GpuDataManagerImplPrivate::GetGPUInfo() const { | 303 gpu::GPUInfo GpuDataManagerImplPrivate::GetGPUInfo() const { |
304 VLOG(2) << "GpuDataManagerImplPrivate::GetGPUInfo()"; | |
305 return gpu_info_; | 304 return gpu_info_; |
306 } | 305 } |
307 | 306 |
308 void GpuDataManagerImplPrivate::GetGpuProcessHandles( | 307 void GpuDataManagerImplPrivate::GetGpuProcessHandles( |
309 const GpuDataManager::GetGpuProcessHandlesCallback& callback) const { | 308 const GpuDataManager::GetGpuProcessHandlesCallback& callback) const { |
310 GpuProcessHost::GetProcessHandles(callback); | 309 GpuProcessHost::GetProcessHandles(callback); |
311 } | 310 } |
312 | 311 |
313 bool GpuDataManagerImplPrivate::GpuAccessAllowed( | 312 bool GpuDataManagerImplPrivate::GpuAccessAllowed( |
314 std::string* reason) const { | 313 std::string* reason) const { |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 use_swiftshader_(false), | 897 use_swiftshader_(false), |
899 use_warp_(false), | 898 use_warp_(false), |
900 card_blacklisted_(false), | 899 card_blacklisted_(false), |
901 update_histograms_(true), | 900 update_histograms_(true), |
902 window_count_(0), | 901 window_count_(0), |
903 domain_blocking_enabled_(true), | 902 domain_blocking_enabled_(true), |
904 owner_(owner), | 903 owner_(owner), |
905 display_count_(0), | 904 display_count_(0), |
906 gpu_process_accessible_(true), | 905 gpu_process_accessible_(true), |
907 finalized_(false) { | 906 finalized_(false) { |
908 VLOG(2) << "GpuDataManagerImplPrivate::GpuDataManagerImplPrivate()"; | |
909 DCHECK(owner_); | 907 DCHECK(owner_); |
910 const base::CommandLine* command_line = | 908 const base::CommandLine* command_line = |
911 base::CommandLine::ForCurrentProcess(); | 909 base::CommandLine::ForCurrentProcess(); |
912 if (command_line->HasSwitch(switches::kDisableGpu)) | 910 if (command_line->HasSwitch(switches::kDisableGpu)) |
913 DisableHardwareAcceleration(); | 911 DisableHardwareAcceleration(); |
914 | 912 |
915 #if defined(OS_MACOSX) | 913 #if defined(OS_MACOSX) |
916 CGGetActiveDisplayList (0, NULL, &display_count_); | 914 CGGetActiveDisplayList (0, NULL, &display_count_); |
917 CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_); | 915 CGDisplayRegisterReconfigurationCallback(DisplayReconfigCallback, owner_); |
918 #endif // OS_MACOSX | 916 #endif // OS_MACOSX |
919 | 917 |
920 // For testing only. | 918 // For testing only. |
921 if (command_line->HasSwitch(switches::kDisableDomainBlockingFor3DAPIs)) { | 919 if (command_line->HasSwitch(switches::kDisableDomainBlockingFor3DAPIs)) { |
922 domain_blocking_enabled_ = false; | 920 domain_blocking_enabled_ = false; |
923 } | 921 } |
924 } | 922 } |
925 | 923 |
926 GpuDataManagerImplPrivate::~GpuDataManagerImplPrivate() { | 924 GpuDataManagerImplPrivate::~GpuDataManagerImplPrivate() { |
927 VLOG(2) << "GpuDataManagerImplPrivate::~GpuDataManagerImplPrivate()"; | |
928 #if defined(OS_MACOSX) | 925 #if defined(OS_MACOSX) |
929 CGDisplayRemoveReconfigurationCallback(DisplayReconfigCallback, owner_); | 926 CGDisplayRemoveReconfigurationCallback(DisplayReconfigCallback, owner_); |
930 #endif | 927 #endif |
931 } | 928 } |
932 | 929 |
933 void GpuDataManagerImplPrivate::InitializeImpl( | 930 void GpuDataManagerImplPrivate::InitializeImpl( |
934 const std::string& gpu_blacklist_json, | 931 const std::string& gpu_blacklist_json, |
935 const std::string& gpu_driver_bug_list_json, | 932 const std::string& gpu_driver_bug_list_json, |
936 const gpu::GPUInfo& gpu_info) { | 933 const gpu::GPUInfo& gpu_info) { |
937 VLOG(2) << "GpuDataManagerImplPrivate::InitializeImpl()"; | |
938 | |
939 const bool log_gpu_control_list_decisions = | 934 const bool log_gpu_control_list_decisions = |
940 base::CommandLine::ForCurrentProcess()->HasSwitch( | 935 base::CommandLine::ForCurrentProcess()->HasSwitch( |
941 switches::kLogGpuControlListDecisions); | 936 switches::kLogGpuControlListDecisions); |
942 | 937 |
943 if (!gpu_blacklist_json.empty()) { | 938 if (!gpu_blacklist_json.empty()) { |
944 gpu_blacklist_.reset(gpu::GpuBlacklist::Create()); | 939 gpu_blacklist_.reset(gpu::GpuBlacklist::Create()); |
945 if (log_gpu_control_list_decisions) | 940 if (log_gpu_control_list_decisions) |
946 gpu_blacklist_->enable_control_list_logging("gpu_blacklist"); | 941 gpu_blacklist_->enable_control_list_logging("gpu_blacklist"); |
947 bool success = gpu_blacklist_->LoadList( | 942 bool success = gpu_blacklist_->LoadList( |
948 gpu_blacklist_json, gpu::GpuControlList::kCurrentOsOnly); | 943 gpu_blacklist_json, gpu::GpuControlList::kCurrentOsOnly); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1133 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1139 #if defined(OS_WIN) | 1134 #if defined(OS_WIN) |
1140 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1135 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1141 #endif | 1136 #endif |
1142 complete_gpu_info_already_requested_ = true; | 1137 complete_gpu_info_already_requested_ = true; |
1143 // Some observers might be waiting. | 1138 // Some observers might be waiting. |
1144 NotifyGpuInfoUpdate(); | 1139 NotifyGpuInfoUpdate(); |
1145 } | 1140 } |
1146 | 1141 |
1147 } // namespace content | 1142 } // namespace content |
OLD | NEW |