| 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 <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" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 } // namespace anonymous | 47 } // namespace anonymous |
| 48 | 48 |
| 49 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { | 49 void MergeFeatureSets(std::set<int>* dst, const std::set<int>& src) { |
| 50 DCHECK(dst); | 50 DCHECK(dst); |
| 51 if (src.empty()) | 51 if (src.empty()) |
| 52 return; | 52 return; |
| 53 dst->insert(src.begin(), src.end()); | 53 dst->insert(src.begin(), src.end()); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void ApplyGpuDriverBugWorkarounds(CommandLine* command_line) { | 56 void ApplyGpuDriverBugWorkarounds(base::CommandLine* command_line) { |
| 57 GPUInfo gpu_info; | 57 GPUInfo gpu_info; |
| 58 CollectBasicGraphicsInfo(&gpu_info); | 58 CollectBasicGraphicsInfo(&gpu_info); |
| 59 | 59 |
| 60 ApplyGpuDriverBugWorkarounds(gpu_info, command_line); | 60 ApplyGpuDriverBugWorkarounds(gpu_info, command_line); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void ApplyGpuDriverBugWorkarounds( | 63 void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info, |
| 64 const GPUInfo& gpu_info, CommandLine* command_line) { | 64 base::CommandLine* command_line) { |
| 65 scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); | 65 scoped_ptr<GpuDriverBugList> list(GpuDriverBugList::Create()); |
| 66 list->LoadList(kGpuDriverBugListJson, | 66 list->LoadList(kGpuDriverBugListJson, |
| 67 GpuControlList::kCurrentOsOnly); | 67 GpuControlList::kCurrentOsOnly); |
| 68 std::set<int> workarounds = list->MakeDecision( | 68 std::set<int> workarounds = list->MakeDecision( |
| 69 GpuControlList::kOsAny, std::string(), gpu_info); | 69 GpuControlList::kOsAny, std::string(), gpu_info); |
| 70 GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 70 GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
| 71 &workarounds, *command_line); | 71 &workarounds, *command_line); |
| 72 if (!workarounds.empty()) { | 72 if (!workarounds.empty()) { |
| 73 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, | 73 command_line->AppendSwitchASCII(switches::kGpuDriverBugWorkarounds, |
| 74 IntSetToString(workarounds)); | 74 IntSetToString(workarounds)); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 void StringToFeatureSet( | 78 void StringToFeatureSet( |
| 79 const std::string& str, std::set<int>* feature_set) { | 79 const std::string& str, std::set<int>* feature_set) { |
| 80 StringToIntSet(str, feature_set); | 80 StringToIntSet(str, feature_set); |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace gpu | 83 } // namespace gpu |
| OLD | NEW |