From cee46e5e99d52a162ec19d7567aeb39083b75ec4 Mon Sep 17 00:00:00 2001 From: Ben Wagner Date: Tue, 12 Jun 2018 16:30:29 -0400 Subject: 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 Commit-Queue: Ben Wagner --- include/core/SkPath.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'include/core/SkPath.h') diff --git a/include/core/SkPath.h b/include/core/SkPath.h index 2846d9f467..9906827ba8 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -1414,10 +1414,18 @@ public: const SkScalar* fConicWeights; SkPoint fMoveTo; SkPoint fLastPt; - SkBool8 fForceClose; - SkBool8 fNeedClose; - SkBool8 fCloseLine; - SkBool8 fSegmentState; + bool fForceClose; + bool fNeedClose; + bool fCloseLine; + enum SegmentState : uint8_t { + /** The current contour is empty. Starting processing or have just closed a contour. */ + kEmptyContour_SegmentState, + /** Have seen a move, but nothing else. */ + kAfterMove_SegmentState, + /** Have seen a primitive but not yet closed the path. Also the initial state. */ + kAfterPrimitive_SegmentState + }; + SegmentState fSegmentState; inline const SkPoint& cons_moveTo(); Verb autoClose(SkPoint pts[2]); @@ -1602,8 +1610,8 @@ private: uint8_t fFillType; mutable SkAtomic fConvexity; mutable SkAtomic fFirstDirection;// SkPathPriv::FirstDirection - SkBool8 fIsVolatile; - SkBool8 fIsBadForDAA = false; + bool fIsVolatile; + bool fIsBadForDAA = false; /** Resets all fields other than fPathRef to their initial 'empty' values. * Assumes the caller has already emptied fPathRef. -- cgit v1.2.3