| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkChunkAlloc.h" | 8 #include "SkChunkAlloc.h" |
| 9 #include "SkPathOpsBounds.h" | 9 #include "SkPathOpsBounds.h" |
| 10 #include "SkPathOpsRect.h" | 10 #include "SkPathOpsRect.h" |
| (...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 | 1015 |
| 1016 template<typename TCurve> | 1016 template<typename TCurve> |
| 1017 SkTSpan<TCurve>* SkTSect<TCurve>::extractCoincident(SkTSect* sect2, SkTSpan<TCur
ve>* first, | 1017 SkTSpan<TCurve>* SkTSect<TCurve>::extractCoincident(SkTSect* sect2, SkTSpan<TCur
ve>* first, |
| 1018 SkTSpan<TCurve>* last) { | 1018 SkTSpan<TCurve>* last) { |
| 1019 first = findCoincidentRun(first, &last, sect2); | 1019 first = findCoincidentRun(first, &last, sect2); |
| 1020 if (!first) { | 1020 if (!first) { |
| 1021 return NULL; | 1021 return NULL; |
| 1022 } | 1022 } |
| 1023 // march outwards to find limit of coincidence from here to previous and nex
t spans | 1023 // march outwards to find limit of coincidence from here to previous and nex
t spans |
| 1024 double startT = first->fStartT; | 1024 double startT = first->fStartT; |
| 1025 double oppStartT; | 1025 double oppStartT SK_INIT_TO_AVOID_WARNING; |
| 1026 double oppEndT SK_INIT_TO_AVOID_WARNING; | 1026 double oppEndT SK_INIT_TO_AVOID_WARNING; |
| 1027 SkTSpan<TCurve>* prev = first->fPrev; | 1027 SkTSpan<TCurve>* prev = first->fPrev; |
| 1028 SkASSERT(first->fCoinStart.isCoincident()); | 1028 SkASSERT(first->fCoinStart.isCoincident()); |
| 1029 SkTSpan<TCurve>* oppFirst = first->findOppT(first->fCoinStart.perpT()); | 1029 SkTSpan<TCurve>* oppFirst = first->findOppT(first->fCoinStart.perpT()); |
| 1030 SkASSERT(last->fCoinEnd.isCoincident()); | 1030 SkASSERT(last->fCoinEnd.isCoincident()); |
| 1031 bool oppMatched = first->fCoinStart.perpT() < first->fCoinEnd.perpT(); | 1031 bool oppMatched = first->fCoinStart.perpT() < first->fCoinEnd.perpT(); |
| 1032 double coinStart; | 1032 double coinStart; |
| 1033 SkDEBUGCODE(double coinEnd); | 1033 SkDEBUGCODE(double coinEnd); |
| 1034 if (prev && prev->fEndT == startT | 1034 if (prev && prev->fEndT == startT |
| 1035 && this->binarySearchCoin(sect2, startT, prev->fStartT - startT, &co
inStart, | 1035 && this->binarySearchCoin(sect2, startT, prev->fStartT - startT, &co
inStart, |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 } else if (intersections->isCoincident(index + 1)) { | 1947 } else if (intersections->isCoincident(index + 1)) { |
| 1948 intersections->removeOne(index + 1); | 1948 intersections->removeOne(index + 1); |
| 1949 --last; | 1949 --last; |
| 1950 } else { | 1950 } else { |
| 1951 intersections->setCoincident(index++); | 1951 intersections->setCoincident(index++); |
| 1952 } | 1952 } |
| 1953 intersections->setCoincident(index); | 1953 intersections->setCoincident(index); |
| 1954 } | 1954 } |
| 1955 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); | 1955 SkASSERT(intersections->used() <= TCurve::kMaxIntersections); |
| 1956 } | 1956 } |
| OLD | NEW |