OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrAAConvexTessellator.h" | 8 #include "GrAAConvexTessellator.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkPath.h" | 10 #include "SkPath.h" |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 | 714 |
715 nextRing->addIdx(newIdx, fCandidateVerts.origEdge(i)); | 715 nextRing->addIdx(newIdx, fCandidateVerts.origEdge(i)); |
716 } | 716 } |
717 | 717 |
718 // 'dst' currently has indices into the ring. Remap these to be indices | 718 // 'dst' currently has indices into the ring. Remap these to be indices |
719 // into the global pool since the triangulation operates in that space. | 719 // into the global pool since the triangulation operates in that space. |
720 for (int i = 0; i < dst.count(); ++i) { | 720 for (int i = 0; i < dst.count(); ++i) { |
721 dst[i] = nextRing->index(dst[i]); | 721 dst[i] = nextRing->index(dst[i]); |
722 } | 722 } |
723 | 723 |
724 for (int cur = 0; cur < lastRing.numPts(); ++cur) { | 724 for (int i = 0; i < lastRing.numPts(); ++i) { |
725 int next = (cur + 1) % lastRing.numPts(); | 725 int next = (i + 1) % lastRing.numPts(); |
726 | 726 |
727 this->addTri(lastRing.index(cur), lastRing.index(next), dst[next]); | 727 this->addTri(lastRing.index(i), lastRing.index(next), dst[next]); |
728 this->addTri(lastRing.index(cur), dst[next], dst[cur]); | 728 this->addTri(lastRing.index(i), dst[next], dst[i]); |
729 } | 729 } |
730 | 730 |
731 if (done && fStrokeWidth < 0.0f) { | 731 if (done && fStrokeWidth < 0.0f) { |
732 // fill | 732 // fill |
733 this->fanRing(*nextRing); | 733 this->fanRing(*nextRing); |
734 } | 734 } |
735 | 735 |
736 if (nextRing->numPts() < 3) { | 736 if (nextRing->numPts() < 3) { |
737 done = true; | 737 done = true; |
738 } | 738 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 SkString num; | 1018 SkString num; |
1019 num.printf("%d", i); | 1019 num.printf("%d", i); |
1020 canvas->drawText(num.c_str(), num.size(), | 1020 canvas->drawText(num.c_str(), num.size(), |
1021 this->point(i).fX, this->point(i).fY+(kPointRadius/2.0f
), | 1021 this->point(i).fX, this->point(i).fY+(kPointRadius/2.0f
), |
1022 paint); | 1022 paint); |
1023 } | 1023 } |
1024 } | 1024 } |
1025 | 1025 |
1026 #endif | 1026 #endif |
1027 | 1027 |
OLD | NEW |