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

Side by Side Diff: src/pathops/SkPathWriter.cpp

Issue 2481463002: use reversePathTo in place of addPathReverse (Closed)
Patch Set: fix nanobench; stop after one contour Created 4 years, 1 month 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 | « src/pathops/SkOpBuilder.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SkOpSpan.h" 7 #include "SkOpSpan.h"
8 #include "SkPathOpsPoint.h" 8 #include "SkPathOpsPoint.h"
9 #include "SkPathWriter.h" 9 #include "SkPathWriter.h"
10 #include "SkTSort.h" 10 #include "SkTSort.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 sIndex < 0 ? ~sIndex : sIndex, eIndex < 0 ? 's' : 'e', 299 sIndex < 0 ? ~sIndex : sIndex, eIndex < 0 ? 's' : 'e',
300 eIndex < 0 ? ~eIndex : eIndex); 300 eIndex < 0 ? ~eIndex : eIndex);
301 #endif 301 #endif
302 do { 302 do {
303 const SkPath& contour = fPartials[rIndex]; 303 const SkPath& contour = fPartials[rIndex];
304 if (forward) { 304 if (forward) {
305 fPathPtr->addPath(contour, 305 fPathPtr->addPath(contour,
306 first ? SkPath::kAppend_AddPathMode : SkPath::kExtend_Ad dPathMode); 306 first ? SkPath::kAppend_AddPathMode : SkPath::kExtend_Ad dPathMode);
307 } else { 307 } else {
308 SkASSERT(!first); 308 SkASSERT(!first);
309 fPathPtr->reverseAddPath(contour); 309 fPathPtr->reversePathTo(contour);
310 } 310 }
311 if (first) { 311 if (first) {
312 first = false; 312 first = false;
313 } 313 }
314 #if DEBUG_ASSEMBLE 314 #if DEBUG_ASSEMBLE
315 SkDebugf("%s rIndex=%d eIndex=%s%d close=%d\n", __FUNCTION__, rIndex , 315 SkDebugf("%s rIndex=%d eIndex=%s%d close=%d\n", __FUNCTION__, rIndex ,
316 eIndex < 0 ? "~" : "", eIndex < 0 ? ~eIndex : eIndex, 316 eIndex < 0 ? "~" : "", eIndex < 0 ? ~eIndex : eIndex,
317 sIndex == ((rIndex != eIndex) ^ forward ? eIndex : ~eIndex)); 317 sIndex == ((rIndex != eIndex) ^ forward ? eIndex : ~eIndex));
318 #endif 318 #endif
319 if (sIndex == ((rIndex != eIndex) ^ forward ? eIndex : ~eIndex)) { 319 if (sIndex == ((rIndex != eIndex) ^ forward ? eIndex : ~eIndex)) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 356 }
357 } while (rIndex < linkCount); 357 } while (rIndex < linkCount);
358 #if DEBUG_ASSEMBLE 358 #if DEBUG_ASSEMBLE
359 for (rIndex = 0; rIndex < linkCount; ++rIndex) { 359 for (rIndex = 0; rIndex < linkCount; ++rIndex) {
360 SkASSERT(sLink[rIndex] == SK_MaxS32); 360 SkASSERT(sLink[rIndex] == SK_MaxS32);
361 SkASSERT(eLink[rIndex] == SK_MaxS32); 361 SkASSERT(eLink[rIndex] == SK_MaxS32);
362 } 362 }
363 #endif 363 #endif
364 return; 364 return;
365 } 365 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpBuilder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698