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 SkOpCoincidence_DEFINED | 7 #ifndef SkOpCoincidence_DEFINED |
8 #define SkOpCoincidence_DEFINED | 8 #define SkOpCoincidence_DEFINED |
9 | 9 |
10 #include "SkOpTAllocator.h" | 10 #include "SkOpTAllocator.h" |
11 #include "SkOpSpan.h" | 11 #include "SkOpSpan.h" |
12 #include "SkPathOpsTypes.h" | 12 #include "SkPathOpsTypes.h" |
13 | 13 |
14 class SkOpPtT; | 14 class SkOpPtT; |
15 | 15 |
16 struct SkCoincidentSpans { | 16 struct SkCoincidentSpans { |
17 SkCoincidentSpans* fNext; | 17 SkCoincidentSpans* fNext; |
18 SkOpPtT* fCoinPtTStart; | 18 SkOpPtT* fCoinPtTStart; |
19 SkOpPtT* fCoinPtTEnd; | 19 SkOpPtT* fCoinPtTEnd; |
20 SkOpPtT* fOppPtTStart; | 20 SkOpPtT* fOppPtTStart; |
21 SkOpPtT* fOppPtTEnd; | 21 SkOpPtT* fOppPtTEnd; |
22 bool fFlipped; | 22 bool fFlipped; |
23 | 23 |
24 void dump() const; | 24 void dump() const; |
25 }; | 25 }; |
26 | 26 |
27 class SkOpCoincidence { | 27 class SkOpCoincidence { |
28 public: | 28 public: |
29 SkOpCoincidence() | 29 SkOpCoincidence() |
30 : fHead(NULL) | 30 : fHead(nullptr) |
31 , fTop(NULL) | 31 , fTop(nullptr) |
32 SkDEBUGPARAMS(fDebugState(NULL)) | 32 SkDEBUGPARAMS(fDebugState(nullptr)) |
33 { | 33 { |
34 } | 34 } |
35 | 35 |
36 void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart, | 36 void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart, |
37 SkOpPtT* oppPtTEnd, SkChunkAlloc* allocator); | 37 SkOpPtT* oppPtTEnd, SkChunkAlloc* allocator); |
38 void addExpanded(SkChunkAlloc* allocator PATH_OPS_DEBUG_VALIDATE_PARAMS(SkO
pGlobalState* )); | 38 void addExpanded(SkChunkAlloc* allocator PATH_OPS_DEBUG_VALIDATE_PARAMS(SkO
pGlobalState* )); |
39 bool addMissing(SkChunkAlloc* allocator); | 39 bool addMissing(SkChunkAlloc* allocator); |
40 void addMissing(SkCoincidentSpans* check, SkChunkAlloc* allocator); | 40 void addMissing(SkCoincidentSpans* check, SkChunkAlloc* allocator); |
41 bool apply(); | 41 bool apply(); |
42 bool contains(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTSta
rt, | 42 bool contains(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTSta
rt, |
43 SkOpPtT* oppPtTEnd, bool flipped); | 43 SkOpPtT* oppPtTEnd, bool flipped); |
44 | 44 |
45 const SkOpAngle* debugAngle(int id) const { | 45 const SkOpAngle* debugAngle(int id) const { |
46 return SkDEBUGRELEASE(fDebugState->debugAngle(id), NULL); | 46 return SkDEBUGRELEASE(fDebugState->debugAngle(id), nullptr); |
47 } | 47 } |
48 | 48 |
49 SkOpContour* debugContour(int id) { | 49 SkOpContour* debugContour(int id) { |
50 return SkDEBUGRELEASE(fDebugState->debugContour(id), NULL); | 50 return SkDEBUGRELEASE(fDebugState->debugContour(id), nullptr); |
51 } | 51 } |
52 | 52 |
53 const SkOpPtT* debugPtT(int id) const { | 53 const SkOpPtT* debugPtT(int id) const { |
54 return SkDEBUGRELEASE(fDebugState->debugPtT(id), NULL); | 54 return SkDEBUGRELEASE(fDebugState->debugPtT(id), nullptr); |
55 } | 55 } |
56 | 56 |
57 const SkOpSegment* debugSegment(int id) const { | 57 const SkOpSegment* debugSegment(int id) const { |
58 return SkDEBUGRELEASE(fDebugState->debugSegment(id), NULL); | 58 return SkDEBUGRELEASE(fDebugState->debugSegment(id), nullptr); |
59 } | 59 } |
60 | 60 |
61 void debugSetGlobalState(SkOpGlobalState* debugState) { | 61 void debugSetGlobalState(SkOpGlobalState* debugState) { |
62 SkDEBUGCODE(fDebugState = debugState); | 62 SkDEBUGCODE(fDebugState = debugState); |
63 } | 63 } |
64 | 64 |
65 void debugShowCoincidence() const; | 65 void debugShowCoincidence() const; |
66 | 66 |
67 const SkOpSpanBase* debugSpan(int id) const { | 67 const SkOpSpanBase* debugSpan(int id) const { |
68 return SkDEBUGRELEASE(fDebugState->debugSpan(id), NULL); | 68 return SkDEBUGRELEASE(fDebugState->debugSpan(id), nullptr); |
69 } | 69 } |
70 | 70 |
71 void detach(SkCoincidentSpans* ); | 71 void detach(SkCoincidentSpans* ); |
72 void dump() const; | 72 void dump() const; |
73 bool expand(); | 73 bool expand(); |
74 bool extend(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart
, | 74 bool extend(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart
, |
75 SkOpPtT* oppPtTEnd); | 75 SkOpPtT* oppPtTEnd); |
76 void findOverlaps(SkOpCoincidence* , SkChunkAlloc* allocator) const; | 76 void findOverlaps(SkOpCoincidence* , SkChunkAlloc* allocator) const; |
77 void fixAligned(); | 77 void fixAligned(); |
78 void fixUp(SkOpPtT* deleted, SkOpPtT* kept); | 78 void fixUp(SkOpPtT* deleted, SkOpPtT* kept); |
(...skipping 19 matching lines...) Expand all Loading... |
98 const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2, | 98 const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2, |
99 double* overS, double* overE) const; | 99 double* overS, double* overE) const; |
100 | 100 |
101 bool testForCoincidence(const SkCoincidentSpans* outer, SkOpPtT* testS, SkOp
PtT* testE) const; | 101 bool testForCoincidence(const SkCoincidentSpans* outer, SkOpPtT* testS, SkOp
PtT* testE) const; |
102 SkCoincidentSpans* fHead; | 102 SkCoincidentSpans* fHead; |
103 SkCoincidentSpans* fTop; | 103 SkCoincidentSpans* fTop; |
104 SkDEBUGCODE_(SkOpGlobalState* fDebugState); | 104 SkDEBUGCODE_(SkOpGlobalState* fDebugState); |
105 }; | 105 }; |
106 | 106 |
107 #endif | 107 #endif |
OLD | NEW |