| 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" |
| 11 #include "SkOpSpan.h" | 11 #include "SkOpSpan.h" |
| 12 #include "SkPathOpsBounds.h" | 12 #include "SkPathOpsBounds.h" |
| 13 #include "SkPathOpsCurve.h" | 13 #include "SkPathOpsCurve.h" |
| 14 #include "SkTArray.h" | 14 #include "SkTArray.h" |
| 15 #include "SkTDArray.h" | 15 #include "SkTDArray.h" |
| 16 | 16 |
| 17 #if defined(SK_DEBUG) || !FORCE_RELEASE |
| 18 #include "SkThread.h" |
| 19 #endif |
| 20 |
| 17 class SkPathWriter; | 21 class SkPathWriter; |
| 18 | 22 |
| 19 class SkOpSegment { | 23 class SkOpSegment { |
| 20 public: | 24 public: |
| 21 SkOpSegment() { | 25 SkOpSegment() { |
| 22 #if defined(SK_DEBUG) || !FORCE_RELEASE | 26 #if defined(SK_DEBUG) || !FORCE_RELEASE |
| 23 fID = ++SkPathOpsDebug::gSegmentID; | 27 fID = sk_atomic_inc(&SkPathOpsDebug::gSegmentID); |
| 24 #endif | 28 #endif |
| 25 } | 29 } |
| 26 | 30 |
| 27 bool operator<(const SkOpSegment& rh) const { | 31 bool operator<(const SkOpSegment& rh) const { |
| 28 return fBounds.fTop < rh.fBounds.fTop; | 32 return fBounds.fTop < rh.fBounds.fTop; |
| 29 } | 33 } |
| 30 | 34 |
| 31 // FIXME: add some template or macro to avoid casting | 35 // FIXME: add some template or macro to avoid casting |
| 32 SkOpAngle& angle(int index) { | 36 SkOpAngle& angle(int index) { |
| 33 const SkOpAngle& cAngle = (const_cast<const SkOpSegment*>(this))->angle(
index); | 37 const SkOpAngle& cAngle = (const_cast<const SkOpSegment*>(this))->angle(
index); |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 bool fSmall; // set if some span is small | 523 bool fSmall; // set if some span is small |
| 520 bool fTiny; // set if some span is tiny | 524 bool fTiny; // set if some span is tiny |
| 521 #if defined(SK_DEBUG) || !FORCE_RELEASE | 525 #if defined(SK_DEBUG) || !FORCE_RELEASE |
| 522 int fID; | 526 int fID; |
| 523 #endif | 527 #endif |
| 524 | 528 |
| 525 friend class PathOpsSegmentTester; | 529 friend class PathOpsSegmentTester; |
| 526 }; | 530 }; |
| 527 | 531 |
| 528 #endif | 532 #endif |
| OLD | NEW |