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

Side by Side Diff: o3d/core/cross/gpu2d/path_processor.cc

Issue 6602049: Pure pedantry: Replace all ".size() == 0" with ".empty()". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2010, Google Inc. 2 * Copyright 2010, Google Inc.
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 cur_segments.push_back(seg); 1098 cur_segments.push_back(seg);
1099 } 1099 }
1100 } 1100 }
1101 } 1101 }
1102 1102
1103 // Subdivide curves at most this many times 1103 // Subdivide curves at most this many times
1104 const int kMaxIter = 5; 1104 const int kMaxIter = 5;
1105 std::vector<SweepInterval> overlaps; 1105 std::vector<SweepInterval> overlaps;
1106 1106
1107 for (int cur_iter = 0; cur_iter < kMaxIter; ++cur_iter) { 1107 for (int cur_iter = 0; cur_iter < kMaxIter; ++cur_iter) {
1108 if (cur_segments.size() == 0) { 1108 if (cur_segments.empty()) {
Peter Kasting 2011/03/02 00:02:42 Nit: "break; // Done" would allow eliminating {}
1109 // Done 1109 // Done
1110 break; 1110 break;
1111 } 1111 }
1112 1112
1113 std::vector<SweepEvent> events; 1113 std::vector<SweepEvent> events;
1114 SweepTree tree(arena_); 1114 SweepTree tree(arena_);
1115 for (std::vector<Segment*>::iterator iter = cur_segments.begin(); 1115 for (std::vector<Segment*>::iterator iter = cur_segments.begin();
1116 iter != cur_segments.end(); 1116 iter != cur_segments.end();
1117 iter++) { 1117 iter++) {
1118 Segment* seg = *iter; 1118 Segment* seg = *iter;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 seg->Triangulate(false, NULL); 1217 seg->Triangulate(false, NULL);
1218 cur_segments.push_back(seg); 1218 cur_segments.push_back(seg);
1219 } 1219 }
1220 } 1220 }
1221 } 1221 }
1222 1222
1223 // Subdivide curves at most this many times 1223 // Subdivide curves at most this many times
1224 const int kMaxIter = 5; 1224 const int kMaxIter = 5;
1225 1225
1226 for (int cur_iter = 0; cur_iter < kMaxIter; ++cur_iter) { 1226 for (int cur_iter = 0; cur_iter < kMaxIter; ++cur_iter) {
1227 if (cur_segments.size() == 0) { 1227 if (cur_segments.empty()) {
1228 // Done 1228 // Done
1229 break; 1229 break;
1230 } 1230 }
1231 1231
1232 for (std::vector<Segment*>::iterator iter = cur_segments.begin(); 1232 for (std::vector<Segment*>::iterator iter = cur_segments.begin();
1233 iter != cur_segments.end(); 1233 iter != cur_segments.end();
1234 iter++) { 1234 iter++) {
1235 Segment* seg = *iter; 1235 Segment* seg = *iter;
1236 if (seg->kind() == Segment::kCubic) { 1236 if (seg->kind() == Segment::kCubic) {
1237 for (std::vector<Segment*>::iterator iter2 = cur_segments.begin(); 1237 for (std::vector<Segment*>::iterator iter2 = cur_segments.begin();
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 internal_gluTessEndPolygon(tess); 1361 internal_gluTessEndPolygon(tess);
1362 for (size_t i = 0; i < state.allocated_pointers.size(); i++) { 1362 for (size_t i = 0; i < state.allocated_pointers.size(); i++) {
1363 free(state.allocated_pointers[i]); 1363 free(state.allocated_pointers[i]);
1364 } 1364 }
1365 internal_gluDeleteTess(tess); 1365 internal_gluDeleteTess(tess);
1366 } 1366 }
1367 1367
1368 } // namespace gpu2d 1368 } // namespace gpu2d
1369 } // namespace o3d 1369 } // namespace o3d
1370 1370
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698