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 #ifndef SkOpContour_DEFINED | 7 #ifndef SkOpContour_DEFINED |
8 #define SkOpContour_DEFINED | 8 #define SkOpContour_DEFINED |
9 | 9 |
10 #include "SkOpSegment.h" | 10 #include "SkOpSegment.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 appendSegment().addConic(pts, weight, this); | 37 appendSegment().addConic(pts, weight, this); |
38 } | 38 } |
39 | 39 |
40 void addCubic(SkPoint pts[4]) { | 40 void addCubic(SkPoint pts[4]) { |
41 appendSegment().addCubic(pts, this); | 41 appendSegment().addCubic(pts, this); |
42 } | 42 } |
43 | 43 |
44 SkOpSegment* addCurve(SkPath::Verb verb, const SkPoint pts[4]); | 44 SkOpSegment* addCurve(SkPath::Verb verb, const SkPoint pts[4]); |
45 | 45 |
46 SkOpSegment* addLine(SkPoint pts[2]) { | 46 SkOpSegment* addLine(SkPoint pts[2]) { |
| 47 SkASSERT(pts[0] != pts[1]); |
47 return appendSegment().addLine(pts, this); | 48 return appendSegment().addLine(pts, this); |
48 } | 49 } |
49 | 50 |
50 void addQuad(SkPoint pts[3]) { | 51 void addQuad(SkPoint pts[3]) { |
51 appendSegment().addQuad(pts, this); | 52 appendSegment().addQuad(pts, this); |
52 } | 53 } |
53 | 54 |
54 SkOpSegment& appendSegment() { | 55 SkOpSegment& appendSegment() { |
55 SkOpSegment* result = fCount++ | 56 SkOpSegment* result = fCount++ |
56 ? SkOpTAllocator<SkOpSegment>::Allocate(this->globalState()->allocat
or()) : &fHead; | 57 ? SkOpTAllocator<SkOpSegment>::Allocate(this->globalState()->allocat
or()) : &fHead; |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 bool fXor; // set if original path had even-odd fill | 412 bool fXor; // set if original path had even-odd fill |
412 bool fOppXor; // set if opposite path had even-odd fill | 413 bool fOppXor; // set if opposite path had even-odd fill |
413 SkDEBUGCODE(int fID); | 414 SkDEBUGCODE(int fID); |
414 SkDEBUGCODE(mutable int fDebugIndent); | 415 SkDEBUGCODE(mutable int fDebugIndent); |
415 }; | 416 }; |
416 | 417 |
417 class SkOpContourHead : public SkOpContour { | 418 class SkOpContourHead : public SkOpContour { |
418 }; | 419 }; |
419 | 420 |
420 #endif | 421 #endif |
OLD | NEW |