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

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

Issue 239563004: fix minor skp-found bugs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix mac-detected errors Created 6 years, 8 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 | « gyp/pathops_unittest.gyp ('k') | src/pathops/SkDLineIntersection.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 7
8 #include "SkIntersections.h" 8 #include "SkIntersections.h"
9 #include "SkPathOpsCubic.h" 9 #include "SkPathOpsCubic.h"
10 #include "SkPathOpsLine.h" 10 #include "SkPathOpsLine.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 SkASSERT(!selfIntersect); 487 SkASSERT(!selfIntersect);
488 return fUsed; 488 return fUsed;
489 } 489 }
490 // FIXME: pass in cached bounds from caller 490 // FIXME: pass in cached bounds from caller
491 SkDRect c2Bounds; 491 SkDRect c2Bounds;
492 c2Bounds.setBounds(c2); 492 c2Bounds.setBounds(c2);
493 if (!(exactEndBits & 4)) { 493 if (!(exactEndBits & 4)) {
494 cubicNearEnd(c1, false, c2, c2Bounds); 494 cubicNearEnd(c1, false, c2, c2Bounds);
495 } 495 }
496 if (!(exactEndBits & 8)) { 496 if (!(exactEndBits & 8)) {
497 if (selfIntersect && fUsed) {
498 return fUsed;
499 }
497 cubicNearEnd(c1, true, c2, c2Bounds); 500 cubicNearEnd(c1, true, c2, c2Bounds);
501 if (selfIntersect && fUsed && ((approximately_less_than_zero(fT[0][0])
502 && approximately_less_than_zero(fT[1][0]))
503 || (approximately_greater_than_one(fT[0][0])
504 && approximately_greater_than_one(fT[1][0])))) {
505 SkASSERT(fUsed == 1);
506 fUsed = 0;
507 return fUsed;
508 }
498 } 509 }
499 if (!selfIntersect) { 510 if (!selfIntersect) {
500 SkDRect c1Bounds; 511 SkDRect c1Bounds;
501 c1Bounds.setBounds(c1); // OPTIMIZE use setRawBounds ? 512 c1Bounds.setBounds(c1); // OPTIMIZE use setRawBounds ?
502 swap(); 513 swap();
503 if (!(exactEndBits & 1)) { 514 if (!(exactEndBits & 1)) {
504 cubicNearEnd(c2, false, c1, c1Bounds); 515 cubicNearEnd(c2, false, c1, c1Bounds);
505 } 516 }
506 if (!(exactEndBits & 2)) { 517 if (!(exactEndBits & 2)) {
507 cubicNearEnd(c2, true, c1, c1Bounds); 518 cubicNearEnd(c2, true, c1, c1Bounds);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 } 652 }
642 (void) intersect(c, c); 653 (void) intersect(c, c);
643 if (used() > 0) { 654 if (used() > 0) {
644 SkASSERT(used() == 1); 655 SkASSERT(used() == 1);
645 if (fT[0][0] > fT[1][0]) { 656 if (fT[0][0] > fT[1][0]) {
646 swapPts(); 657 swapPts();
647 } 658 }
648 } 659 }
649 return used(); 660 return used();
650 } 661 }
OLDNEW
« no previous file with comments | « gyp/pathops_unittest.gyp ('k') | src/pathops/SkDLineIntersection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698