Chromium Code Reviews| 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 |
|
no sievers
2016/04/05 19:02:42
#include <memory>
Mostyn Bramley-Moore
2016/04/05 21:35:32
Done.
| |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "gpu/config/gpu_control_list_jsons.h" | 14 #include "gpu/config/gpu_control_list_jsons.h" |
| 15 #include "gpu/config/gpu_driver_bug_list.h" | 15 #include "gpu/config/gpu_driver_bug_list.h" |
| 16 #include "gpu/config/gpu_info_collector.h" | 16 #include "gpu/config/gpu_info_collector.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 | 49 |
| 50 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { | 50 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { |
| 51 DCHECK(dst); | 51 DCHECK(dst); |
| 52 if (src.empty()) | 52 if (src.empty()) |
| 53 return; | 53 return; |
| 54 dst->insert(src.begin(), src.end()); | 54 dst->insert(src.begin(), src.end()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, | 57 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, |
| 58 base::CommandLine* command_line) { | 58 base::CommandLine* command_line) { |
| 59 scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 59 std::unique_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
| 60 list->LoadList(kGpuDriverBugListJson, | 60 list->LoadList(kGpuDriverBugListJson, |
| 61 GpuControlList::kCurrentOsOnly); | 61 GpuControlList::kCurrentOsOnly); |
| 62 std::set<int> workarounds = list->MakeDecision( | 62 std::set<int> workarounds = list->MakeDecision( |
| 63 GpuControlList::kOsAny, std::string(), gpu_info); | 63 GpuControlList::kOsAny, std::string(), gpu_info); |
| 64 GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 64 GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
| 65 &workarounds, *command_line); | 65 &workarounds, *command_line); |
| 66 if (!workarounds.empty()) { | 66 if (!workarounds.empty()) { |
| 67 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, | 67 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, |
| 68 IntSetToString(workarounds)); | 68 IntSetToString(workarounds)); |
| 69 } | 69 } |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 89 base::JoinString(v, " ")); | 89 base::JoinString(v, " ")); |
| 90 } | 90 } |
| 91 } | 91 } |
| 92 | 92 |
| 93 void StringToFeatureSet( | 93 void StringToFeatureSet( |
| 94 const std::string& str, std::set<int>* feature_set) { | 94 const std::string& str, std::set<int>* feature_set) { |
| 95 StringToIntSet(str, feature_set); | 95 StringToIntSet(str, feature_set); |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace gpu | 98 } // namespace gpu |
| OLD | NEW |