diff options
author | Ben Wagner <bungeman@google.com> | 2018-06-12 16:30:29 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-12 21:30:24 +0000 |
commit | cee46e5e99d52a162ec19d7567aeb39083b75ec4 (patch) | |
tree | 6bd1efddd26dbf1a3192007dd2f5c8c39ae1d65b /src | |
parent | 75e6490a2952849d72ecb1e59c97e36db8908884 (diff) |
Remove SkBool8.
This typedef was created at a time when compilers often used sizeof(int)
storage for a bool. This is no longer the case and in all compilers
currently supported 'sizeof(bool) == 1'. Removing this also revealed one
field which was actually not a bool but a tri-state enum.
Change-Id: I9240ba457335ee3eff094d6d3f2520c1adf16960
Reviewed-on: https://skia-review.googlesource.com/134420
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPath.cpp | 23 | ||||
-rw-r--r-- | src/core/SkStroke.h | 2 |
2 files changed, 8 insertions, 17 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 605454bcf7..e38d736294 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -202,9 +202,9 @@ bool operator==(const SkPath& a, const SkPath& b) { void SkPath::swap(SkPath& that) { if (this != &that) { fPathRef.swap(that.fPathRef); - SkTSwap<int>(fLastMoveToIndex, that.fLastMoveToIndex); - SkTSwap<uint8_t>(fFillType, that.fFillType); - SkTSwap<SkBool8>(fIsVolatile, that.fIsVolatile); + SkTSwap(fLastMoveToIndex, that.fLastMoveToIndex); + SkTSwap(fFillType, that.fFillType); + SkTSwap(fIsVolatile, that.fIsVolatile); // Non-atomic swaps of atomic values. Convexity c = fConvexity.load(); @@ -1821,15 +1821,6 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const { /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// -enum SegmentState { - kEmptyContour_SegmentState, // The current contour is empty. We may be - // starting processing or we may have just - // closed a contour. - kAfterMove_SegmentState, // We have seen a move, but nothing else. - kAfterPrimitive_SegmentState // We have seen a primitive but not yet - // closed the path. Also the initial state. -}; - SkPath::Iter::Iter() { #ifdef SK_DEBUG fPts = nullptr; @@ -1918,11 +1909,11 @@ const SkPoint& SkPath::Iter::cons_moveTo() { // Set the first return pt to the move pt fSegmentState = kAfterPrimitive_SegmentState; return fMoveTo; - } else { - SkASSERT(fSegmentState == kAfterPrimitive_SegmentState); - // Set the first return pt to the last pt of the previous primitive. - return fPts[-1]; } + + SkASSERT(fSegmentState == kAfterPrimitive_SegmentState); + // Set the first return pt to the last pt of the previous primitive. + return fPts[-1]; } void SkPath::Iter::consumeDegenerateSegments(bool exact) { diff --git a/src/core/SkStroke.h b/src/core/SkStroke.h index 09783b73d9..189b5cf0d9 100644 --- a/src/core/SkStroke.h +++ b/src/core/SkStroke.h @@ -71,7 +71,7 @@ private: SkScalar fWidth, fMiterLimit; SkScalar fResScale; uint8_t fCap, fJoin; - SkBool8 fDoFill; + bool fDoFill; friend class SkPaint; }; |