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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 } | 506 } |
507 | 507 |
508 void GpuDataManagerImplPrivate::Initialize() { | 508 void GpuDataManagerImplPrivate::Initialize() { |
509 TRACE_EVENT0("startup", "GpuDataManagerImpl::Initialize"); | 509 TRACE_EVENT0("startup", "GpuDataManagerImpl::Initialize"); |
510 if (finalized_) { | 510 if (finalized_) { |
511 DVLOG(0) << "GpuDataManagerImpl marked as finalized; skipping Initialize"; | 511 DVLOG(0) << "GpuDataManagerImpl marked as finalized; skipping Initialize"; |
512 return; | 512 return; |
513 } | 513 } |
514 | 514 |
515 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 515 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
516 if (command_line->HasSwitch(switches::kSkipGpuDataLoading)) | 516 if (command_line->HasSwitch(switches::kSkipGpuDataLoading)) { |
| 517 RunPostInitTasks(); |
517 return; | 518 return; |
| 519 } |
518 | 520 |
519 gpu::GPUInfo gpu_info; | 521 gpu::GPUInfo gpu_info; |
520 if (command_line->GetSwitchValueASCII( | 522 if (command_line->GetSwitchValueASCII( |
521 switches::kUseGL) == gfx::kGLImplementationOSMesaName) { | 523 switches::kUseGL) == gfx::kGLImplementationOSMesaName) { |
522 // If using the OSMesa GL implementation, use fake vendor and device ids to | 524 // If using the OSMesa GL implementation, use fake vendor and device ids to |
523 // make sure it never gets blacklisted. This is better than simply | 525 // make sure it never gets blacklisted. This is better than simply |
524 // cancelling GPUInfo gathering as it allows us to proceed with loading the | 526 // cancelling GPUInfo gathering as it allows us to proceed with loading the |
525 // blacklist below which may have non-device specific entries we want to | 527 // blacklist below which may have non-device specific entries we want to |
526 // apply anyways (e.g., OS version blacklisting). | 528 // apply anyways (e.g., OS version blacklisting). |
527 gpu_info.gpu.vendor_id = 0xffff; | 529 gpu_info.gpu.vendor_id = 0xffff; |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 bool success = gpu_driver_bug_list_->LoadList( | 1063 bool success = gpu_driver_bug_list_->LoadList( |
1062 gpu_driver_bug_list_json, gpu::GpuControlList::kCurrentOsOnly); | 1064 gpu_driver_bug_list_json, gpu::GpuControlList::kCurrentOsOnly); |
1063 DCHECK(success); | 1065 DCHECK(success); |
1064 } | 1066 } |
1065 | 1067 |
1066 gpu_info_ = gpu_info; | 1068 gpu_info_ = gpu_info; |
1067 UpdateGpuInfo(gpu_info); | 1069 UpdateGpuInfo(gpu_info); |
1068 UpdateGpuSwitchingManager(gpu_info); | 1070 UpdateGpuSwitchingManager(gpu_info); |
1069 UpdatePreliminaryBlacklistedFeatures(); | 1071 UpdatePreliminaryBlacklistedFeatures(); |
1070 | 1072 |
| 1073 RunPostInitTasks(); |
| 1074 } |
| 1075 |
| 1076 void GpuDataManagerImplPrivate::RunPostInitTasks() { |
1071 // Set initialized before running callbacks. | 1077 // Set initialized before running callbacks. |
1072 is_initialized_ = true; | 1078 is_initialized_ = true; |
1073 | 1079 |
1074 for (const auto& callback : post_init_tasks_) | 1080 for (const auto& callback : post_init_tasks_) |
1075 callback.Run(); | 1081 callback.Run(); |
1076 post_init_tasks_.clear(); | 1082 post_init_tasks_.clear(); |
1077 } | 1083 } |
1078 | 1084 |
1079 void GpuDataManagerImplPrivate::UpdateBlacklistedFeatures( | 1085 void GpuDataManagerImplPrivate::UpdateBlacklistedFeatures( |
1080 const std::set<int>& features) { | 1086 const std::set<int>& features) { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1238 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1244 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1239 #if defined(OS_WIN) | 1245 #if defined(OS_WIN) |
1240 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1246 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1241 #endif | 1247 #endif |
1242 complete_gpu_info_already_requested_ = true; | 1248 complete_gpu_info_already_requested_ = true; |
1243 // Some observers might be waiting. | 1249 // Some observers might be waiting. |
1244 NotifyGpuInfoUpdate(); | 1250 NotifyGpuInfoUpdate(); |
1245 } | 1251 } |
1246 | 1252 |
1247 } // namespace content | 1253 } // namespace content |
OLD | NEW |