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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
635 | 635 |
636 bool was_info_available = IsCompleteGpuInfoAvailable(); | 636 bool was_info_available = IsCompleteGpuInfoAvailable(); |
637 gpu::MergeGPUInfo(&gpu_info_, gpu_info); | 637 gpu::MergeGPUInfo(&gpu_info_, gpu_info); |
638 if (IsCompleteGpuInfoAvailable()) { | 638 if (IsCompleteGpuInfoAvailable()) { |
639 complete_gpu_info_already_requested_ = true; | 639 complete_gpu_info_already_requested_ = true; |
640 } else if (was_info_available) { | 640 } else if (was_info_available) { |
641 // Allow future requests to go through properly. | 641 // Allow future requests to go through properly. |
642 complete_gpu_info_already_requested_ = false; | 642 complete_gpu_info_already_requested_ = false; |
643 } | 643 } |
644 | 644 |
645 #if !defined(OS_MACOSX) | |
646 // TODO(j.isorce): Currenly the GPU process does not know about any secondary | |
647 // gpu. So for now it requires to do the identification here because gpu_info_ | |
648 // contains both secondary_gpus and gl_vendor/gl_renderer information. | |
649 gpu::IdentifyActiveGPU(&gpu_info_); | |
Ken Russell (switch to Gerrit)
2016/04/05 03:31:24
This change looks wrong. It's not guaranteed at th
| |
650 #endif | |
651 | |
645 UpdateGpuInfoHelper(); | 652 UpdateGpuInfoHelper(); |
646 } | 653 } |
647 | 654 |
648 void GpuDataManagerImplPrivate::UpdateVideoMemoryUsageStats( | 655 void GpuDataManagerImplPrivate::UpdateVideoMemoryUsageStats( |
649 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) { | 656 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) { |
650 GpuDataManagerImpl::UnlockedSession session(owner_); | 657 GpuDataManagerImpl::UnlockedSession session(owner_); |
651 observer_list_->Notify(FROM_HERE, | 658 observer_list_->Notify(FROM_HERE, |
652 &GpuDataManagerObserver::OnVideoMemoryUsageStatsUpdate, | 659 &GpuDataManagerObserver::OnVideoMemoryUsageStatsUpdate, |
653 video_memory_usage_stats); | 660 video_memory_usage_stats); |
654 } | 661 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 // device_id, driver_vendor, driver_version for deciding whether we need to | 737 // device_id, driver_vendor, driver_version for deciding whether we need to |
731 // collect full info (on Linux) and for crash reporting purpose. | 738 // collect full info (on Linux) and for crash reporting purpose. |
732 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 739 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
733 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 740 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
734 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 741 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
735 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); | 742 base::StringPrintf("0x%04x", gpu_info_.gpu.device_id)); |
736 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, | 743 command_line->AppendSwitchASCII(switches::kGpuDriverVendor, |
737 gpu_info_.driver_vendor); | 744 gpu_info_.driver_vendor); |
738 command_line->AppendSwitchASCII(switches::kGpuDriverVersion, | 745 command_line->AppendSwitchASCII(switches::kGpuDriverVersion, |
739 gpu_info_.driver_version); | 746 gpu_info_.driver_version); |
747 command_line->AppendSwitchASCII(switches::kGpuDriverDate, | |
748 gpu_info_.driver_date); | |
740 } | 749 } |
741 | 750 |
742 void GpuDataManagerImplPrivate::AppendPluginCommandLine( | 751 void GpuDataManagerImplPrivate::AppendPluginCommandLine( |
743 base::CommandLine* command_line) const { | 752 base::CommandLine* command_line) const { |
744 DCHECK(command_line); | 753 DCHECK(command_line); |
745 | 754 |
746 #if defined(OS_MACOSX) | 755 #if defined(OS_MACOSX) |
747 // TODO(jbauman): Add proper blacklist support for core animation plugins so | 756 // TODO(jbauman): Add proper blacklist support for core animation plugins so |
748 // special-casing this video card won't be necessary. See | 757 // special-casing this video card won't be necessary. See |
749 // http://crbug.com/134015 | 758 // http://crbug.com/134015 |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1244 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; | 1253 gpu_info_.context_info_state = gpu::kCollectInfoFatalFailure; |
1245 #if defined(OS_WIN) | 1254 #if defined(OS_WIN) |
1246 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; | 1255 gpu_info_.dx_diagnostics_info_state = gpu::kCollectInfoFatalFailure; |
1247 #endif | 1256 #endif |
1248 complete_gpu_info_already_requested_ = true; | 1257 complete_gpu_info_already_requested_ = true; |
1249 // Some observers might be waiting. | 1258 // Some observers might be waiting. |
1250 NotifyGpuInfoUpdate(); | 1259 NotifyGpuInfoUpdate(); |
1251 } | 1260 } |
1252 | 1261 |
1253 } // namespace content | 1262 } // namespace content |
OLD | NEW |