| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkOpSegment_DEFINE | 7 #ifndef SkOpSegment_DEFINE |
| 8 #define SkOpSegment_DEFINE | 8 #define SkOpSegment_DEFINE |
| 9 | 9 |
| 10 #include "SkOpAngle.h" | 10 #include "SkOpAngle.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 bool activeOp(int index, int endIndex, int xorMiMask, int xorSuMask, SkPathO
p op); | 241 bool activeOp(int index, int endIndex, int xorMiMask, int xorSuMask, SkPathO
p op); |
| 242 bool activeWinding(int index, int endIndex); | 242 bool activeWinding(int index, int endIndex); |
| 243 void addCubic(const SkPoint pts[4], bool operand, bool evenOdd); | 243 void addCubic(const SkPoint pts[4], bool operand, bool evenOdd); |
| 244 void addCurveTo(int start, int end, SkPathWriter* path, bool active) const; | 244 void addCurveTo(int start, int end, SkPathWriter* path, bool active) const; |
| 245 void addLine(const SkPoint pts[2], bool operand, bool evenOdd); | 245 void addLine(const SkPoint pts[2], bool operand, bool evenOdd); |
| 246 void addOtherT(int index, double otherT, int otherIndex); | 246 void addOtherT(int index, double otherT, int otherIndex); |
| 247 void addQuad(const SkPoint pts[3], bool operand, bool evenOdd); | 247 void addQuad(const SkPoint pts[3], bool operand, bool evenOdd); |
| 248 int addSelfT(SkOpSegment* other, const SkPoint& pt, double newT); | 248 int addSelfT(SkOpSegment* other, const SkPoint& pt, double newT); |
| 249 int addT(SkOpSegment* other, const SkPoint& pt, double newT, bool isNear); | 249 int addT(SkOpSegment* other, const SkPoint& pt, double newT, bool isNear); |
| 250 void addTCancel(const SkPoint& startPt, const SkPoint& endPt, SkOpSegment* o
ther); | 250 void addTCancel(const SkPoint& startPt, const SkPoint& endPt, SkOpSegment* o
ther); |
| 251 void addTCoincident(const SkPoint& startPt, const SkPoint& endPt, SkOpSegmen
t* other); | 251 void addTCoincident(const SkPoint& startPt, const SkPoint& endPt, double end
T, |
| 252 SkOpSegment* other); |
| 252 void addTPair(double t, SkOpSegment* other, double otherT, bool borrowWind,
const SkPoint& pt); | 253 void addTPair(double t, SkOpSegment* other, double otherT, bool borrowWind,
const SkPoint& pt); |
| 253 bool betweenTs(int lesser, double testT, int greater) const; | 254 bool betweenTs(int lesser, double testT, int greater) const; |
| 254 void checkEnds(); | 255 void checkEnds(); |
| 255 bool checkSmall(int index) const; | 256 bool checkSmall(int index) const; |
| 256 void checkTiny(); | 257 void checkTiny(); |
| 257 int computeSum(int startIndex, int endIndex, SkOpAngle::IncludeType includeT
ype, | 258 int computeSum(int startIndex, int endIndex, SkOpAngle::IncludeType includeT
ype, |
| 258 SkTArray<SkOpAngle, true>* angles, SkTArray<SkOpAngle*, true
>* sorted); | 259 SkTArray<SkOpAngle, true>* angles, SkTArray<SkOpAngle*, true
>* sorted); |
| 259 int crossedSpanY(const SkPoint& basePt, SkScalar* bestY, double* hitT, bool*
hitSomething, | 260 int crossedSpanY(const SkPoint& basePt, SkScalar* bestY, double* hitT, bool*
hitSomething, |
| 260 double mid, bool opp, bool current) const; | 261 double mid, bool opp, bool current) const; |
| 261 SkOpSegment* findNextOp(SkTDArray<SkOpSpan*>* chase, int* nextStart, int* ne
xtEnd, | 262 SkOpSegment* findNextOp(SkTDArray<SkOpSpan*>* chase, int* nextStart, int* ne
xtEnd, |
| 262 bool* unsortable, SkPathOp op, const int xorMiMask, | 263 bool* unsortable, SkPathOp op, const int xorMiMask, |
| 263 const int xorSuMask); | 264 const int xorSuMask); |
| 264 SkOpSegment* findNextWinding(SkTDArray<SkOpSpan*>* chase, int* nextStart, in
t* nextEnd, | 265 SkOpSegment* findNextWinding(SkTDArray<SkOpSpan*>* chase, int* nextStart, in
t* nextEnd, |
| 265 bool* unsortable); | 266 bool* unsortable); |
| 266 SkOpSegment* findNextXor(int* nextStart, int* nextEnd, bool* unsortable); | 267 SkOpSegment* findNextXor(int* nextStart, int* nextEnd, bool* unsortable); |
| 267 SkOpSegment* findTop(int* tIndex, int* endIndex, bool* unsortable, bool only
Sortable); | 268 SkOpSegment* findTop(int* tIndex, int* endIndex, bool* unsortable, bool only
Sortable); |
| 268 void fixOtherTIndex(); | 269 void fixOtherTIndex(); |
| 269 void initWinding(int start, int end); | 270 void initWinding(int start, int end); |
| 270 void initWinding(int start, int end, double tHit, int winding, SkScalar hitD
x, int oppWind, | 271 void initWinding(int start, int end, double tHit, int winding, SkScalar hitD
x, int oppWind, |
| 271 SkScalar hitOppDx); | 272 SkScalar hitOppDx); |
| 272 bool isMissing(double startT) const; | 273 bool isMissing(double startT, const SkPoint& pt) const; |
| 273 bool isTiny(const SkOpAngle* angle) const; | 274 bool isTiny(const SkOpAngle* angle) const; |
| 274 SkOpSpan* markAndChaseDoneBinary(int index, int endIndex); | 275 SkOpSpan* markAndChaseDoneBinary(int index, int endIndex); |
| 275 SkOpSpan* markAndChaseDoneUnary(int index, int endIndex); | 276 SkOpSpan* markAndChaseDoneUnary(int index, int endIndex); |
| 276 SkOpSpan* markAndChaseWinding(const SkOpAngle* angle, int winding, int oppWi
nding); | 277 SkOpSpan* markAndChaseWinding(const SkOpAngle* angle, int winding, int oppWi
nding); |
| 277 SkOpSpan* markAngle(int maxWinding, int sumWinding, int oppMaxWinding, int o
ppSumWinding, | 278 SkOpSpan* markAngle(int maxWinding, int sumWinding, int oppMaxWinding, int o
ppSumWinding, |
| 278 bool activeAngle, const SkOpAngle* angle); | 279 bool activeAngle, const SkOpAngle* angle); |
| 279 void markDone(int index, int winding); | 280 void markDone(int index, int winding); |
| 280 void markDoneBinary(int index); | 281 void markDoneBinary(int index); |
| 281 void markDoneUnary(int index); | 282 void markDoneUnary(int index); |
| 282 bool nextCandidate(int* start, int* end) const; | 283 bool nextCandidate(int* start, int* end) const; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 309 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY | 310 #if DEBUG_ACTIVE_SPANS || DEBUG_ACTIVE_SPANS_FIRST_ONLY |
| 310 void debugShowActiveSpans() const; | 311 void debugShowActiveSpans() const; |
| 311 #endif | 312 #endif |
| 312 #if DEBUG_SORT || DEBUG_SWAP_TOP | 313 #if DEBUG_SORT || DEBUG_SWAP_TOP |
| 313 void debugShowSort(const char* fun, const SkTArray<SkOpAngle*, true>& angles
, int first, | 314 void debugShowSort(const char* fun, const SkTArray<SkOpAngle*, true>& angles
, int first, |
| 314 const int contourWinding, const int oppContourWinding, bool sortable
) const; | 315 const int contourWinding, const int oppContourWinding, bool sortable
) const; |
| 315 void debugShowSort(const char* fun, const SkTArray<SkOpAngle*, true>& angles
, int first, | 316 void debugShowSort(const char* fun, const SkTArray<SkOpAngle*, true>& angles
, int first, |
| 316 bool sortable); | 317 bool sortable); |
| 317 #endif | 318 #endif |
| 318 #if DEBUG_CONCIDENT | 319 #if DEBUG_CONCIDENT |
| 319 void debugShowTs() const; | 320 void debugShowTs(const char* prefix) const; |
| 320 #endif | 321 #endif |
| 321 #if DEBUG_SHOW_WINDING | 322 #if DEBUG_SHOW_WINDING |
| 322 int debugShowWindingValues(int slotCount, int ofInterest) const; | 323 int debugShowWindingValues(int slotCount, int ofInterest) const; |
| 323 #endif | 324 #endif |
| 324 | 325 |
| 325 private: | 326 private: |
| 326 struct MissingSpan { | 327 struct MissingSpan { |
| 327 enum Command { | 328 enum Command { |
| 328 kNoAction, | 329 kNoAction, |
| 329 kAddMissing, | 330 kAddMissing, |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 SkPath::Verb fVerb; | 453 SkPath::Verb fVerb; |
| 453 bool fOperand; | 454 bool fOperand; |
| 454 bool fXor; // set if original contour had even-odd fill | 455 bool fXor; // set if original contour had even-odd fill |
| 455 bool fOppXor; // set if opposite operand had even-odd fill | 456 bool fOppXor; // set if opposite operand had even-odd fill |
| 456 #ifdef SK_DEBUG | 457 #ifdef SK_DEBUG |
| 457 int fID; | 458 int fID; |
| 458 #endif | 459 #endif |
| 459 }; | 460 }; |
| 460 | 461 |
| 461 #endif | 462 #endif |
| OLD | NEW |