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