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

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

Issue 2426173002: fix fuzzers (Closed)
Patch Set: fix dm 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 | « no previous file | src/pathops/SkDConicLineIntersection.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 "SkOpCoincidence.h" 8 #include "SkOpCoincidence.h"
9 #include "SkPathOpsBounds.h" 9 #include "SkPathOpsBounds.h"
10 10
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 break; 443 break;
444 } 444 }
445 case SkIntersectionHelper::kConic_Segment: { 445 case SkIntersectionHelper::kConic_Segment: {
446 pts = ts.intersect(conic1.set(wt.pts(), wt.weight()) , 446 pts = ts.intersect(conic1.set(wt.pts(), wt.weight()) ,
447 conic2.set(wn.pts(), wn.weight())); 447 conic2.set(wn.pts(), wn.weight()));
448 debugShowConicIntersection(pts, wt, wn, ts); 448 debugShowConicIntersection(pts, wt, wn, ts);
449 break; 449 break;
450 } 450 }
451 case SkIntersectionHelper::kCubic_Segment: { 451 case SkIntersectionHelper::kCubic_Segment: {
452 swap = true; 452 swap = true;
453 pts = ts.intersect(cubic2.set(wn.pts()), 453 pts = ts.intersect(cubic2.set(wn.pts()
454 conic1.set(wt.pts(), wt.weight())); 454 SkDEBUGPARAMS(ts.globalState())),
455 conic1.set(wt.pts(), wt.weight()
456 SkDEBUGPARAMS(ts.globalState())));
455 debugShowCubicConicIntersection(pts, wn, wt, ts); 457 debugShowCubicConicIntersection(pts, wn, wt, ts);
456 break; 458 break;
457 } 459 }
458 } 460 }
459 break; 461 break;
460 case SkIntersectionHelper::kCubic_Segment: 462 case SkIntersectionHelper::kCubic_Segment:
461 switch (wn.segmentType()) { 463 switch (wn.segmentType()) {
462 case SkIntersectionHelper::kHorizontalLine_Segment: 464 case SkIntersectionHelper::kHorizontalLine_Segment:
463 pts = ts.cubicHorizontal(wt.pts(), wn.left(), 465 pts = ts.cubicHorizontal(wt.pts(), wn.left(),
464 wn.right(), wn.y(), wn.xFlipped()); 466 wn.right(), wn.y(), wn.xFlipped());
465 debugShowCubicLineIntersection(pts, wt, wn, ts); 467 debugShowCubicLineIntersection(pts, wt, wn, ts);
466 break; 468 break;
467 case SkIntersectionHelper::kVerticalLine_Segment: 469 case SkIntersectionHelper::kVerticalLine_Segment:
468 pts = ts.cubicVertical(wt.pts(), wn.top(), 470 pts = ts.cubicVertical(wt.pts(), wn.top(),
469 wn.bottom(), wn.x(), wn.yFlipped()); 471 wn.bottom(), wn.x(), wn.yFlipped());
470 debugShowCubicLineIntersection(pts, wt, wn, ts); 472 debugShowCubicLineIntersection(pts, wt, wn, ts);
471 break; 473 break;
472 case SkIntersectionHelper::kLine_Segment: 474 case SkIntersectionHelper::kLine_Segment:
473 pts = ts.cubicLine(wt.pts(), wn.pts()); 475 pts = ts.cubicLine(wt.pts(), wn.pts());
474 debugShowCubicLineIntersection(pts, wt, wn, ts); 476 debugShowCubicLineIntersection(pts, wt, wn, ts);
475 break; 477 break;
476 case SkIntersectionHelper::kQuad_Segment: { 478 case SkIntersectionHelper::kQuad_Segment: {
477 pts = ts.intersect(cubic1.set(wt.pts()), quad2.set(w n.pts())); 479 pts = ts.intersect(cubic1.set(wt.pts()), quad2.set(w n.pts()));
478 debugShowCubicQuadIntersection(pts, wt, wn, ts); 480 debugShowCubicQuadIntersection(pts, wt, wn, ts);
479 break; 481 break;
480 } 482 }
481 case SkIntersectionHelper::kConic_Segment: { 483 case SkIntersectionHelper::kConic_Segment: {
482 pts = ts.intersect(cubic1.set(wt.pts()), 484 pts = ts.intersect(cubic1.set(wt.pts()
483 conic2.set(wn.pts(), wn.weight())); 485 SkDEBUGPARAMS(ts.globalState())),
486 conic2.set(wn.pts(), wn.weight()
487 SkDEBUGPARAMS(ts.globalState())));
484 debugShowCubicConicIntersection(pts, wt, wn, ts); 488 debugShowCubicConicIntersection(pts, wt, wn, ts);
485 break; 489 break;
486 } 490 }
487 case SkIntersectionHelper::kCubic_Segment: { 491 case SkIntersectionHelper::kCubic_Segment: {
488 pts = ts.intersect(cubic1.set(wt.pts()), cubic2.set( wn.pts())); 492 pts = ts.intersect(cubic1.set(wt.pts()), cubic2.set( wn.pts()));
489 debugShowCubicIntersection(pts, wt, wn, ts); 493 debugShowCubicIntersection(pts, wt, wn, ts);
490 break; 494 break;
491 } 495 }
492 default: 496 default:
493 SkASSERT(0); 497 SkASSERT(0);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 coincidence->add(coinPtT[0], testTAt, coinPtT[1], nextTAt); 559 coincidence->add(coinPtT[0], testTAt, coinPtT[1], nextTAt);
556 wt.segment()->debugValidate(); 560 wt.segment()->debugValidate();
557 wn.segment()->debugValidate(); 561 wn.segment()->debugValidate();
558 coinIndex = -1; 562 coinIndex = -1;
559 } 563 }
560 SkASSERT(coinIndex < 0); // expect coincidence to be paired 564 SkASSERT(coinIndex < 0); // expect coincidence to be paired
561 } while (wn.advance()); 565 } while (wn.advance());
562 } while (wt.advance()); 566 } while (wt.advance());
563 return true; 567 return true;
564 } 568 }
OLDNEW
« no previous file with comments | « no previous file | src/pathops/SkDConicLineIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698