| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 str, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { | 54 str, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { |
| 55 uint32_t id = 0; | 55 uint32_t id = 0; |
| 56 bool succeed = base::HexStringToUInt(piece, &id); | 56 bool succeed = base::HexStringToUInt(piece, &id); |
| 57 DCHECK(succeed); | 57 DCHECK(succeed); |
| 58 list->push_back(id); | 58 list->push_back(id); |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace anonymous | 62 } // namespace anonymous |
| 63 | 63 |
| 64 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { | |
| 65 DCHECK(dst); | |
| 66 if (src.empty()) | |
| 67 return; | |
| 68 dst->insert(src.begin(), src.end()); | |
| 69 } | |
| 70 | |
| 71 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, | 64 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, |
| 72 base::CommandLine* command_line) { | 65 base::CommandLine* command_line) { |
| 73 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 66 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
| 74 list->LoadList(kGpuDriverBugListJson, | 67 list->LoadList(kGpuDriverBugListJson, |
| 75 GpuControlList::kCurrentOsOnly); | 68 GpuControlList::kCurrentOsOnly); |
| 76 std::set<int> workarounds = list->MakeDecision( | 69 std::set<int> workarounds = list->MakeDecision( |
| 77 GpuControlList::kOsAny, std::string(), gpu_info); | 70 GpuControlList::kOsAny, std::string(), gpu_info); |
| 78 GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 71 GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
| 79 &workarounds, *command_line); | 72 &workarounds, *command_line); |
| 80 if (!workarounds.empty()) { | 73 if (!workarounds.empty()) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 ui::GpuSwitchingManager::GetInstance(); | 145 ui::GpuSwitchingManager::GetInstance(); |
| 153 if (!switching_manager->SupportsDualGpus()) | 146 if (!switching_manager->SupportsDualGpus()) |
| 154 return; | 147 return; |
| 155 if (driver_bug_workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1) | 148 if (driver_bug_workarounds.count(gpu::FORCE_DISCRETE_GPU) == 1) |
| 156 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); | 149 ui::GpuSwitchingManager::GetInstance()->ForceUseOfDiscreteGpu(); |
| 157 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) | 150 else if (driver_bug_workarounds.count(gpu::FORCE_INTEGRATED_GPU) == 1) |
| 158 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); | 151 ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu(); |
| 159 } | 152 } |
| 160 | 153 |
| 161 } // namespace gpu | 154 } // namespace gpu |
| OLD | NEW |