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

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

Issue 52653002: pathops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add raster vs gpu test Created 7 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 | Annotate | Revision Log
« no previous file with comments | « gyp/skpskgr_test.gyp ('k') | src/pathops/SkDCubicIntersection.cpp » ('j') | 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 "SkAddIntersections.h" 7 #include "SkAddIntersections.h"
8 #include "SkPathOpsBounds.h" 8 #include "SkPathOpsBounds.h"
9 9
10 #if DEBUG_ADD_INTERSECTING_TS 10 #if DEBUG_ADD_INTERSECTING_TS
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 continue; 376 continue;
377 } 377 }
378 ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1) 378 ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
379 pts = 1; 379 pts = 1;
380 } 380 }
381 } 381 }
382 if (pts >= 2) { 382 if (pts >= 2) {
383 for (int pt = 0; pt < pts - 1; ++pt) { 383 for (int pt = 0; pt < pts - 1; ++pt) {
384 const SkDPoint& point = ts.pt(pt); 384 const SkDPoint& point = ts.pt(pt);
385 const SkDPoint& next = ts.pt(pt + 1); 385 const SkDPoint& next = ts.pt(pt + 1);
386 if (wt.isNear(ts[swap][pt], ts[swap][pt + 1], point, next) 386 if (wt.isPartial(ts[swap][pt], ts[swap][pt + 1], point, next )
387 && wn.isNear(ts[!swap][pt], ts[!swap][pt + 1], point , next)) { 387 && wn.isPartial(ts[!swap][pt], ts[!swap][pt + 1], po int, next)) {
388 if (!wt.addPartialCoincident(wn, ts, pt, swap)) { 388 if (!wt.addPartialCoincident(wn, ts, pt, swap)) {
389 // remove extra point if two map to same float value s 389 // remove extra point if two map to same float value s
390 ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1) 390 ts.cleanUpCoincidence(); // prefer (t == 0 or t == 1)
391 pts = 1; 391 pts = 1;
392 } 392 }
393 } 393 }
394 } 394 }
395 } 395 }
396 for (int pt = 0; pt < pts; ++pt) { 396 for (int pt = 0; pt < pts; ++pt) {
397 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1); 397 SkASSERT(ts[0][pt] >= 0 && ts[0][pt] <= 1);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 441 }
442 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { 442 for (int cIndex = 0; cIndex < contourCount; ++cIndex) {
443 SkOpContour* contour = (*contourList)[cIndex]; 443 SkOpContour* contour = (*contourList)[cIndex];
444 contour->calcCoincidentWinding(); 444 contour->calcCoincidentWinding();
445 } 445 }
446 for (int cIndex = 0; cIndex < contourCount; ++cIndex) { 446 for (int cIndex = 0; cIndex < contourCount; ++cIndex) {
447 SkOpContour* contour = (*contourList)[cIndex]; 447 SkOpContour* contour = (*contourList)[cIndex];
448 contour->calcPartialCoincidentWinding(); 448 contour->calcPartialCoincidentWinding();
449 } 449 }
450 } 450 }
OLDNEW
« no previous file with comments | « gyp/skpskgr_test.gyp ('k') | src/pathops/SkDCubicIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698