| OLD | NEW |
| 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 "SkIntersections.h" | 7 #include "SkIntersections.h" |
| 8 #include "SkPathOpsCubic.h" | 8 #include "SkPathOpsCubic.h" |
| 9 #include "SkPathOpsCurve.h" | 9 #include "SkPathOpsCurve.h" |
| 10 #include "SkPathOpsLine.h" | 10 #include "SkPathOpsLine.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 enum PinTPoint { | 80 enum PinTPoint { |
| 81 kPointUninitialized, | 81 kPointUninitialized, |
| 82 kPointInitialized | 82 kPointInitialized |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 LineCubicIntersections(const SkDCubic& c, const SkDLine& l, SkIntersections*
i) | 85 LineCubicIntersections(const SkDCubic& c, const SkDLine& l, SkIntersections*
i) |
| 86 : fCubic(c) | 86 : fCubic(c) |
| 87 , fLine(l) | 87 , fLine(l) |
| 88 , fIntersections(i) | 88 , fIntersections(i) |
| 89 , fAllowNear(true) { | 89 , fAllowNear(true) { |
| 90 i->setMax(3); | 90 i->setMax(4); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void allowNear(bool allow) { | 93 void allowNear(bool allow) { |
| 94 fAllowNear = allow; | 94 fAllowNear = allow; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void checkCoincident() { | 97 void checkCoincident() { |
| 98 int last = fIntersections->used() - 1; | 98 int last = fIntersections->used() - 1; |
| 99 for (int index = 0; index < last; ) { | 99 for (int index = 0; index < last; ) { |
| 100 double cubicMidT = ((*fIntersections)[0][index] + (*fIntersections)[
0][index + 1]) / 2; | 100 double cubicMidT = ((*fIntersections)[0][index] + (*fIntersections)[
0][index + 1]) / 2; |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 // SkDCubic accessors to Intersection utilities | 446 // SkDCubic accessors to Intersection utilities |
| 447 | 447 |
| 448 int SkDCubic::horizontalIntersect(double yIntercept, double roots[3]) const { | 448 int SkDCubic::horizontalIntersect(double yIntercept, double roots[3]) const { |
| 449 return LineCubicIntersections::HorizontalIntersect(*this, yIntercept, roots)
; | 449 return LineCubicIntersections::HorizontalIntersect(*this, yIntercept, roots)
; |
| 450 } | 450 } |
| 451 | 451 |
| 452 int SkDCubic::verticalIntersect(double xIntercept, double roots[3]) const { | 452 int SkDCubic::verticalIntersect(double xIntercept, double roots[3]) const { |
| 453 return LineCubicIntersections::VerticalIntersect(*this, xIntercept, roots); | 453 return LineCubicIntersections::VerticalIntersect(*this, xIntercept, roots); |
| 454 } | 454 } |
| OLD | NEW |