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/command_buffer/service/feature_info.h" | 5 #include "gpu/command_buffer/service/feature_info.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 private: | 67 private: |
68 std::set<std::string> string_set_; | 68 std::set<std::string> string_set_; |
69 }; | 69 }; |
70 | 70 |
71 // Process a string of wordaround type IDs (seperated by ',') and set up | 71 // Process a string of wordaround type IDs (seperated by ',') and set up |
72 // the corresponding Workaround flags. | 72 // the corresponding Workaround flags. |
73 void StringToWorkarounds( | 73 void StringToWorkarounds( |
74 const std::string& types, FeatureInfo::Workarounds* workarounds) { | 74 const std::string& types, FeatureInfo::Workarounds* workarounds) { |
75 DCHECK(workarounds); | 75 DCHECK(workarounds); |
76 std::vector<std::string> pieces; | 76 std::vector<std::string> pieces = base::SplitString( |
77 base::SplitString(types, ',', &pieces); | 77 types, ",", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY); |
78 for (size_t i = 0; i < pieces.size(); ++i) { | 78 for (size_t i = 0; i < pieces.size(); ++i) { |
79 int number = 0; | 79 int number = 0; |
80 bool succeed = base::StringToInt(pieces[i], &number); | 80 bool succeed = base::StringToInt(pieces[i], &number); |
81 DCHECK(succeed); | 81 DCHECK(succeed); |
82 switch (number) { | 82 switch (number) { |
83 #define GPU_OP(type, name) \ | 83 #define GPU_OP(type, name) \ |
84 case gpu::type: \ | 84 case gpu::type: \ |
85 workarounds->name = true; \ | 85 workarounds->name = true; \ |
86 break; | 86 break; |
87 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) | 87 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 if (pos == std::string::npos) { | 1153 if (pos == std::string::npos) { |
1154 extensions_ += (extensions_.empty() ? "" : " ") + str; | 1154 extensions_ += (extensions_.empty() ? "" : " ") + str; |
1155 } | 1155 } |
1156 } | 1156 } |
1157 | 1157 |
1158 FeatureInfo::~FeatureInfo() { | 1158 FeatureInfo::~FeatureInfo() { |
1159 } | 1159 } |
1160 | 1160 |
1161 } // namespace gles2 | 1161 } // namespace gles2 |
1162 } // namespace gpu | 1162 } // namespace gpu |
OLD | NEW |