| 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 16 matching lines...) Expand all Loading... |
| 27 SkASSERT(0); // the original curve is a cubic, which will never red
uce to a conic | 27 SkASSERT(0); // the original curve is a cubic, which will never red
uce to a conic |
| 28 } break; | 28 } break; |
| 29 case SkPath::kCubic_Verb: { | 29 case SkPath::kCubic_Verb: { |
| 30 SkPoint* ptStorage = SkOpTAllocator<SkPoint>::AllocateArray(allocato
r, 4); | 30 SkPoint* ptStorage = SkOpTAllocator<SkPoint>::AllocateArray(allocato
r, 4); |
| 31 memcpy(ptStorage, pts, sizeof(SkPoint) * 4); | 31 memcpy(ptStorage, pts, sizeof(SkPoint) * 4); |
| 32 return appendSegment(allocator).addCubic(ptStorage, this); | 32 return appendSegment(allocator).addCubic(ptStorage, this); |
| 33 } break; | 33 } break; |
| 34 default: | 34 default: |
| 35 SkASSERT(0); | 35 SkASSERT(0); |
| 36 } | 36 } |
| 37 return NULL; | 37 return nullptr; |
| 38 } | 38 } |
| 39 | 39 |
| 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(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 59 | 59 |
| 60 SkOpSegment* SkOpContour::undoneSegment(SkOpSpanBase** startPtr, SkOpSpanBase**
endPtr) { | 60 SkOpSegment* SkOpContour::undoneSegment(SkOpSpanBase** startPtr, SkOpSpanBase**
endPtr) { |
| 61 SkOpSegment* segment = &fHead; | 61 SkOpSegment* segment = &fHead; |
| 62 do { | 62 do { |
| 63 if (segment->done()) { | 63 if (segment->done()) { |
| 64 continue; | 64 continue; |
| 65 } | 65 } |
| 66 segment->undoneSpan(startPtr, endPtr); | 66 segment->undoneSpan(startPtr, endPtr); |
| 67 return segment; | 67 return segment; |
| 68 } while ((segment = segment->next())); | 68 } while ((segment = segment->next())); |
| 69 return NULL; | 69 return nullptr; |
| 70 } | 70 } |
| OLD | NEW |