| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkOpContour.h" | 7 #include "SkOpContour.h" |
| 8 #include "SkOpTAllocator.h" | 8 #include "SkOpTAllocator.h" |
| 9 #include "SkPathWriter.h" | 9 #include "SkPathWriter.h" |
| 10 #include "SkReduceOrder.h" | 10 #include "SkReduceOrder.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void SkOpContour::toPath(SkPathWriter* path) const { | 40 void SkOpContour::toPath(SkPathWriter* path) const { |
| 41 const SkPoint& pt = fHead.pts()[0]; | 41 const SkPoint& pt = fHead.pts()[0]; |
| 42 path->deferredMove(pt); | 42 path->deferredMove(pt); |
| 43 const SkOpSegment* segment = &fHead; | 43 const SkOpSegment* segment = &fHead; |
| 44 do { | 44 do { |
| 45 segment->addCurveTo(segment->head(), segment->tail(), path, true); | 45 segment->addCurveTo(segment->head(), segment->tail(), path, true); |
| 46 } while ((segment = segment->next())); | 46 } while ((segment = segment->next())); |
| 47 path->close(); | 47 path->close(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 void SkOpContour::toReversePath(SkPathWriter* path) const { |
| 51 const SkPoint& pt = fTail->pts()[0]; |
| 52 path->deferredMove(pt); |
| 53 const SkOpSegment* segment = fTail; |
| 54 do { |
| 55 segment->addCurveTo(segment->tail(), segment->head(), path, true); |
| 56 } while ((segment = segment->prev())); |
| 57 path->close(); |
| 58 } |
| 59 |
| 50 SkOpSegment* SkOpContour::undoneSegment(SkOpSpanBase** startPtr, SkOpSpanBase**
endPtr) { | 60 SkOpSegment* SkOpContour::undoneSegment(SkOpSpanBase** startPtr, SkOpSpanBase**
endPtr) { |
| 51 SkOpSegment* segment = &fHead; | 61 SkOpSegment* segment = &fHead; |
| 52 do { | 62 do { |
| 53 if (segment->done()) { | 63 if (segment->done()) { |
| 54 continue; | 64 continue; |
| 55 } | 65 } |
| 56 segment->undoneSpan(startPtr, endPtr); | 66 segment->undoneSpan(startPtr, endPtr); |
| 57 return segment; | 67 return segment; |
| 58 } while ((segment = segment->next())); | 68 } while ((segment = segment->next())); |
| 59 return NULL; | 69 return NULL; |
| 60 } | 70 } |
| OLD | NEW |