| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_driver_bug_list.h" | 5 #include "gpu/config/gpu_driver_bug_list.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "gpu/config/gpu_driver_bug_workaround_type.h" | 9 #include "gpu/config/gpu_driver_bug_workaround_type.h" |
| 10 #include "gpu/config/gpu_switches.h" |
| 11 #include "gpu/config/gpu_util.h" |
| 10 | 12 |
| 11 namespace gpu { | 13 namespace gpu { |
| 12 | 14 |
| 13 namespace { | 15 namespace { |
| 14 | 16 |
| 15 struct GpuDriverBugWorkaroundInfo { | 17 struct GpuDriverBugWorkaroundInfo { |
| 16 GpuDriverBugWorkaroundType type; | 18 GpuDriverBugWorkaroundType type; |
| 17 const char* name; | 19 const char* name; |
| 18 }; | 20 }; |
| 19 | 21 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 return kFeatureList[type].name; | 53 return kFeatureList[type].name; |
| 52 else | 54 else |
| 53 return "unknown"; | 55 return "unknown"; |
| 54 } | 56 } |
| 55 | 57 |
| 56 // static | 58 // static |
| 57 void GpuDriverBugList::AppendWorkaroundsFromCommandLine( | 59 void GpuDriverBugList::AppendWorkaroundsFromCommandLine( |
| 58 std::set<int>* workarounds, | 60 std::set<int>* workarounds, |
| 59 const base::CommandLine& command_line) { | 61 const base::CommandLine& command_line) { |
| 60 DCHECK(workarounds); | 62 DCHECK(workarounds); |
| 63 |
| 64 if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) { |
| 65 std::string cmd_workarounds_str = |
| 66 command_line.GetSwitchValueASCII(switches::kGpuDriverBugWorkarounds); |
| 67 std::set<int> cmd_workarounds; |
| 68 gpu::StringToFeatureSet(cmd_workarounds_str, &cmd_workarounds); |
| 69 workarounds->insert(cmd_workarounds.begin(), cmd_workarounds.end()); |
| 70 } |
| 71 |
| 61 for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; i++) { | 72 for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; i++) { |
| 62 if (command_line.HasSwitch(kFeatureList[i].name)) { | 73 if (command_line.HasSwitch(kFeatureList[i].name)) { |
| 63 // Check for disabling workaround flag. | 74 // Check for disabling workaround flag. |
| 64 if (command_line.GetSwitchValueASCII(kFeatureList[i].name) == "0") { | 75 if (command_line.GetSwitchValueASCII(kFeatureList[i].name) == "0") { |
| 65 workarounds->erase(kFeatureList[i].type); | 76 workarounds->erase(kFeatureList[i].type); |
| 66 continue; | 77 continue; |
| 67 } | 78 } |
| 68 | 79 |
| 69 // Removing conflicting workarounds. | 80 // Removing conflicting workarounds. |
| 70 switch (kFeatureList[i].type) { | 81 switch (kFeatureList[i].type) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 87 default: | 98 default: |
| 88 workarounds->insert(kFeatureList[i].type); | 99 workarounds->insert(kFeatureList[i].type); |
| 89 break; | 100 break; |
| 90 } | 101 } |
| 91 } | 102 } |
| 92 } | 103 } |
| 93 } | 104 } |
| 94 | 105 |
| 95 } // namespace gpu | 106 } // namespace gpu |
| 96 | 107 |
| OLD | NEW |