Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: src/pathops/SkOpCoincidence.h

Issue 1182493015: pathops coincident fixes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: all tests (including extended) work Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pathops/SkOpCoincidence.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkOpCoincidence.h
diff --git a/src/pathops/SkOpCoincidence.h b/src/pathops/SkOpCoincidence.h
index ce57999b1df4adbfa8029e0c5f3bbbfe4b098620..83ba70a0f917841c9dcd93a74db2ea56ec739e6c 100644
--- a/src/pathops/SkOpCoincidence.h
+++ b/src/pathops/SkOpCoincidence.h
@@ -9,6 +9,7 @@
#include "SkOpTAllocator.h"
#include "SkOpSpan.h"
+#include "SkPathOpsTypes.h"
class SkOpPtT;
@@ -26,36 +27,81 @@ struct SkCoincidentSpans {
class SkOpCoincidence {
public:
SkOpCoincidence()
- : fHead(NULL) {
+ : fHead(NULL)
+ , fTop(NULL)
+ SkDEBUGPARAMS(fDebugState(NULL))
+ {
}
void add(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
SkOpPtT* oppPtTEnd, SkChunkAlloc* allocator);
+ void addExpanded(SkChunkAlloc* allocator PATH_OPS_DEBUG_VALIDATE_PARAMS(SkOpGlobalState* ));
bool addMissing(SkChunkAlloc* allocator);
void addMissing(SkCoincidentSpans* check, SkChunkAlloc* allocator);
bool apply();
bool contains(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
SkOpPtT* oppPtTEnd, bool flipped);
+
+ const SkOpAngle* debugAngle(int id) const {
+ return SkDEBUGRELEASE(fDebugState->debugAngle(id), NULL);
+ }
+
+ SkOpContour* debugContour(int id) {
+ return SkDEBUGRELEASE(fDebugState->debugContour(id), NULL);
+ }
+
+ const SkOpPtT* debugPtT(int id) const {
+ return SkDEBUGRELEASE(fDebugState->debugPtT(id), NULL);
+ }
+
+ const SkOpSegment* debugSegment(int id) const {
+ return SkDEBUGRELEASE(fDebugState->debugSegment(id), NULL);
+ }
+
+ void debugSetGlobalState(SkOpGlobalState* debugState) {
+ SkDEBUGCODE(fDebugState = debugState);
+ }
+
void debugShowCoincidence() const;
+
+ const SkOpSpanBase* debugSpan(int id) const {
+ return SkDEBUGRELEASE(fDebugState->debugSpan(id), NULL);
+ }
+
void detach(SkCoincidentSpans* );
void dump() const;
- void expand();
+ bool expand();
bool extend(SkOpPtT* coinPtTStart, SkOpPtT* coinPtTEnd, SkOpPtT* oppPtTStart,
SkOpPtT* oppPtTEnd);
+ void findOverlaps(SkOpCoincidence* , SkChunkAlloc* allocator) const;
+ void fixAligned();
void fixUp(SkOpPtT* deleted, SkOpPtT* kept);
+
+ bool isEmpty() const {
+ return !fHead;
+ }
+
void mark();
private:
+ void addIfMissing(const SkCoincidentSpans* outer, SkOpPtT* over1s, SkOpPtT* over1e,
+ SkChunkAlloc* );
bool addIfMissing(const SkOpPtT* over1s, const SkOpPtT* over1e,
- const SkOpPtT* over2s, const SkOpPtT* over2e, double tStart, double tEnd,
+ const SkOpPtT* over2s, const SkOpPtT* over2e,
+ double tStart, double tEnd,
SkOpPtT* coinPtTStart, const SkOpPtT* coinPtTEnd,
SkOpPtT* oppPtTStart, const SkOpPtT* oppPtTEnd,
- SkChunkAlloc* allocator);
+ SkChunkAlloc* );
+ void addOverlap(SkOpSegment* seg1, SkOpSegment* seg1o, SkOpSegment* seg2, SkOpSegment* seg2o,
+ SkOpPtT* overS, SkOpPtT* overE, SkChunkAlloc* );
bool overlap(const SkOpPtT* coinStart1, const SkOpPtT* coinEnd1,
const SkOpPtT* coinStart2, const SkOpPtT* coinEnd2,
double* overS, double* overE) const;
+ bool testForCoincidence(const SkCoincidentSpans* outer, SkOpPtT* testS, SkOpPtT* testE) const;
SkCoincidentSpans* fHead;
+ SkCoincidentSpans* fTop;
+ SkDEBUGCODE_(SkOpGlobalState* fDebugState);
};
#endif
« no previous file with comments | « no previous file | src/pathops/SkOpCoincidence.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698