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