Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: gpu/command_buffer/service/feature_info.cc

Issue 1272823003: Update SplitString calls to new form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « google_apis/gaia/gaia_auth_util.cc ('k') | gpu/config/gpu_control_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 private: 77 private:
78 std::set<std::string> string_set_; 78 std::set<std::string> string_set_;
79 }; 79 };
80 80
81 // Process a string of wordaround type IDs (seperated by ',') and set up 81 // Process a string of wordaround type IDs (seperated by ',') and set up
82 // the corresponding Workaround flags. 82 // the corresponding Workaround flags.
83 void StringToWorkarounds( 83 void StringToWorkarounds(
84 const std::string& types, FeatureInfo::Workarounds* workarounds) { 84 const std::string& types, FeatureInfo::Workarounds* workarounds) {
85 DCHECK(workarounds); 85 DCHECK(workarounds);
86 std::vector<std::string> pieces; 86 for (const base::StringPiece& piece :
87 base::SplitString(types, ',', &pieces); 87 base::SplitStringPiece(
88 for (size_t i = 0; i < pieces.size(); ++i) { 88 types, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
89 int number = 0; 89 int number = 0;
90 bool succeed = base::StringToInt(pieces[i], &number); 90 bool succeed = base::StringToInt(piece, &number);
91 DCHECK(succeed); 91 DCHECK(succeed);
92 switch (number) { 92 switch (number) {
93 #define GPU_OP(type, name) \ 93 #define GPU_OP(type, name) \
94 case gpu::type: \ 94 case gpu::type: \
95 workarounds->name = true; \ 95 workarounds->name = true; \
96 break; 96 break;
97 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) 97 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
98 #undef GPU_OP 98 #undef GPU_OP
99 default: 99 default:
100 NOTIMPLEMENTED(); 100 NOTIMPLEMENTED();
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 if (pos == std::string::npos) { 1150 if (pos == std::string::npos) {
1151 extensions_ += (extensions_.empty() ? "" : " ") + str; 1151 extensions_ += (extensions_.empty() ? "" : " ") + str;
1152 } 1152 }
1153 } 1153 }
1154 1154
1155 FeatureInfo::~FeatureInfo() { 1155 FeatureInfo::~FeatureInfo() {
1156 } 1156 }
1157 1157
1158 } // namespace gles2 1158 } // namespace gles2
1159 } // namespace gpu 1159 } // namespace gpu
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_auth_util.cc ('k') | gpu/config/gpu_control_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698