diff options
author | Chris Craik <ccraik@google.com> | 2015-08-20 15:14:06 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-08-21 23:05:44 +0000 |
commit | b9ce116dac378b4cf4490f265dcbd5704a1dd43c (patch) | |
tree | 359fda22ac4f3c659c1afe2542a8266b9278318b /libs/hwui/Outline.h | |
parent | e4a6f925621e9360238869ae28f7df1b4c2d97de (diff) |
Switch several enums to enum classes
Change-Id: I00ecd0b61657196b51704f70ca31a9d1c1ac254e
Diffstat (limited to 'libs/hwui/Outline.h')
-rw-r--r-- | libs/hwui/Outline.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/libs/hwui/Outline.h b/libs/hwui/Outline.h index 8d4d4f085f98..4bd4ae1d48c9 100644 --- a/libs/hwui/Outline.h +++ b/libs/hwui/Outline.h @@ -28,13 +28,13 @@ class Outline { public: Outline() : mShouldClip(false) - , mType(kOutlineType_None) + , mType(Type::None) , mRadius(0) , mAlpha(0.0f) {} void setRoundRect(int left, int top, int right, int bottom, float radius, float alpha) { mAlpha = alpha; - if (mType == kOutlineType_RoundRect + if (mType == Type::RoundRect && left == mBounds.left && right == mBounds.right && top == mBounds.top @@ -44,7 +44,7 @@ public: return; } - mType = kOutlineType_RoundRect; + mType = Type::RoundRect; mBounds.set(left, top, right, bottom); mRadius = radius; @@ -63,26 +63,26 @@ public: setEmpty(); return; } - mType = kOutlineType_ConvexPath; + mType = Type::ConvexPath; mPath = *outline; mBounds.set(outline->getBounds()); mAlpha = alpha; } void setEmpty() { - mType = kOutlineType_Empty; + mType = Type::Empty; mPath.reset(); mAlpha = 0.0f; } void setNone() { - mType = kOutlineType_None; + mType = Type::None; mPath.reset(); mAlpha = 0.0f; } bool isEmpty() const { - return mType == kOutlineType_Empty; + return mType == Type::Empty; } float getAlpha() const { @@ -99,7 +99,7 @@ public: bool willClip() const { // only round rect outlines can be used for clipping - return mShouldClip && (mType == kOutlineType_RoundRect); + return mShouldClip && (mType == Type::RoundRect); } bool willRoundRectClip() const { @@ -108,7 +108,7 @@ public: } bool getAsRoundRect(Rect* outRect, float* outRadius) const { - if (mType == kOutlineType_RoundRect) { + if (mType == Type::RoundRect) { outRect->set(mBounds); *outRadius = mRadius; return true; @@ -117,21 +117,21 @@ public: } const SkPath* getPath() const { - if (mType == kOutlineType_None || mType == kOutlineType_Empty) return nullptr; + if (mType == Type::None || mType == Type::Empty) return nullptr; return &mPath; } private: - enum OutlineType { - kOutlineType_None = 0, - kOutlineType_Empty = 1, - kOutlineType_ConvexPath = 2, - kOutlineType_RoundRect = 3 + enum class Type { + None = 0, + Empty = 1, + ConvexPath = 2, + RoundRect = 3 }; bool mShouldClip; - OutlineType mType; + Type mType; Rect mBounds; float mRadius; float mAlpha; |