| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/config/gpu_util.h" | 5 #include "gpu/config/gpu_util.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } // namespace anonymous | 62 } // namespace anonymous |
| 63 | 63 |
| 64 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { | 64 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { |
| 65 DCHECK(dst); | 65 DCHECK(dst); |
| 66 if (src.empty()) | 66 if (src.empty()) |
| 67 return; | 67 return; |
| 68 dst->insert(src.begin(), src.end()); | 68 dst->insert(src.begin(), src.end()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, | 71 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, |
| 72 const std::string& os_version, |
| 72 base::CommandLine* command_line) { | 73 base::CommandLine* command_line) { |
| 73 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 74 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
| 74 list->LoadList(kGpuDriverBugListJson, | 75 list->LoadList(kGpuDriverBugListJson, |
| 75 GpuControlList::kCurrentOsOnly); | 76 GpuControlList::kCurrentOsOnly); |
| 76 std::set<int> workarounds = list->MakeDecision( | 77 std::set<int> workarounds = |
| 77 GpuControlList::kOsAny, std::string(), gpu_info); | 78 list->MakeDecision(GpuControlList::kOsAny, os_version, gpu_info); |
| 78 GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 79 GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
| 79 &workarounds, *command_line); | 80 &workarounds, *command_line); |
| 80 if (!workarounds.empty()) { | 81 if (!workarounds.empty()) { |
| 81 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, | 82 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, |
| 82 IntSetToString(workarounds)); | 83 IntSetToString(workarounds)); |
| 83 } | 84 } |
| 84 | 85 |
| 85 std::set<std::string> disabled_extensions; | 86 std::set<std::string> disabled_extensions; |
| 86 std::vector<std::string> buglist_disabled_extensions = | 87 std::vector<std::string> buglist_disabled_extensions = |
| 87 list->GetDisabledExtensions(); | 88 list->GetDisabledExtensions(); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 ui::GpuSwitchingManager::GetInstance(); | 153 ui::GpuSwitchingManager::GetInstance(); |
| 153 if (!switching_manager->SupportsDualGpus()) | 154 if (!switching_manager->SupportsDualGpus()) |
| 154 return; | 155 return; |
| 155 if (driver_bug_workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1) | 156 if (driver_bug_workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1) |
| 156 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); | 157 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); |
| 157 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) | 158 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) |
| 158 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); | 159 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); |
| 159 } | 160 } |
| 160 | 161 |
| 161 } // namespace gpu | 162 } // namespace gpu |
| OLD | NEW |