diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 2a6100db8d..18b23ff2e7 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -42,12 +42,6 @@ class SkSurface; class SkSurface_Base; class SkTextBlob; -#ifdef SK_SUPPORT_LEGACY_CLIPOPS_PLAIN_ENUM - #define SkCanvasImpl_DefaultClipOp kIntersect_SkClipOp -#else - #define SkCanvasImpl_DefaultClipOp SkClipOp::kIntersect -#endif - /** \class SkCanvas A Canvas encapsulates all of the state about drawing into a device (bitmap). @@ -483,7 +477,7 @@ public: this->clipRect(rect, op, false); } void clipRect(const SkRect& rect, bool doAntiAlias = false) { - this->clipRect(rect, SkCanvasImpl_DefaultClipOp, doAntiAlias); + this->clipRect(rect, SkClipOp::kIntersect, doAntiAlias); } /** @@ -508,7 +502,7 @@ public: this->clipRRect(rrect, op, false); } void clipRRect(const SkRRect& rrect, bool doAntiAlias = false) { - this->clipRRect(rrect, SkCanvasImpl_DefaultClipOp, doAntiAlias); + this->clipRRect(rrect, SkClipOp::kIntersect, doAntiAlias); } /** @@ -522,7 +516,7 @@ public: this->clipPath(path, op, false); } void clipPath(const SkPath& path, bool doAntiAlias = false) { - this->clipPath(path, SkCanvasImpl_DefaultClipOp, doAntiAlias); + this->clipPath(path, SkClipOp::kIntersect, doAntiAlias); } /** EXPERIMENTAL -- only used for testing @@ -539,7 +533,7 @@ public: @param deviceRgn The region to apply to the current clip @param op The region op to apply to the current clip */ - void clipRegion(const SkRegion& deviceRgn, SkClipOp op = SkCanvasImpl_DefaultClipOp); + void clipRegion(const SkRegion& deviceRgn, SkClipOp op = SkClipOp::kIntersect); /** Return true if the specified rectangle, after being transformed by the current matrix, would lie completely outside of the current clip. Call diff --git a/include/core/SkClipOp.h b/include/core/SkClipOp.h index 45e0044d7c..1c4b3b713b 100644 --- a/include/core/SkClipOp.h +++ b/include/core/SkClipOp.h @@ -12,22 +12,6 @@ // SkClipOp enum values always match the corresponding values in SkRegion::Op -#ifdef SK_SUPPORT_LEGACY_CLIPOPS_PLAIN_ENUM - -enum SkClipOp { - kDifference_SkClipOp = 0, - kIntersect_SkClipOp = 1, - - // Goal: remove these, since they can grow the current clip - - kUnion_SkClipOp = 2, - kXOR_SkClipOp = 3, - kReverseDifference_SkClipOp = 4, - kReplace_SkClipOp = 5, -}; - -#else - enum class SkClipOp { kDifference = 0, kIntersect = 1, @@ -80,5 +64,3 @@ enum class SkClipOp { }; #endif - -#endif diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h index 95e8a94c46..dce6904318 100644 --- a/include/core/SkClipStack.h +++ b/include/core/SkClipStack.h @@ -18,15 +18,6 @@ class SkCanvasClipVisitor; - -#ifdef SK_SUPPORT_LEGACY_CLIPOPS_PLAIN_ENUM - #define SkClipStackImpl_UnionOp kUnion_SkClipOp - #define SkClipStackImpl_ReplaceOp kReplace_SkClipOp -#else - #define SkClipStackImpl_UnionOp SkClipOp::kUnion_private_internal_do_not_use - #define SkClipStackImpl_ReplaceOp SkClipOp::kReplace_private_internal_do_not_use -#endif - // Because a single save/restore state can have multiple clips, this class // stores the stack depth (fSaveCount) and clips (fDeque) separately. // Each clip in fDeque stores the stack state to which it belongs @@ -63,7 +54,7 @@ public: static const int kTypeCnt = kLastType + 1; Element() { - this->initCommon(0, SkClipStackImpl_ReplaceOp, false); + this->initCommon(0, SkClipOp::kReplace_private_internal_do_not_use, false); this->setEmpty(); } @@ -235,7 +226,7 @@ public: int fGenID; Element(int saveCount) { - this->initCommon(saveCount, SkClipStackImpl_ReplaceOp, false); + this->initCommon(saveCount, SkClipOp::kReplace_private_internal_do_not_use, false); this->setEmpty(); } @@ -525,7 +516,7 @@ private: void restoreTo(int saveCount); inline bool hasClipRestriction(SkClipOp op) { - return op >= SkClipStackImpl_UnionOp && !fClipRestrictionRect.isEmpty(); + return op >= SkClipOp::kUnion_private_internal_do_not_use && !fClipRestrictionRect.isEmpty(); } /** diff --git a/src/core/SkClipOpPriv.h b/src/core/SkClipOpPriv.h index 00fb5baf91..4af442ada9 100644 --- a/src/core/SkClipOpPriv.h +++ b/src/core/SkClipOpPriv.h @@ -10,7 +10,6 @@ #include "SkClipOp.h" -#ifndef SK_SUPPORT_LEGACY_CLIPOPS_PLAIN_ENUM const SkClipOp kDifference_SkClipOp = SkClipOp::kDifference; const SkClipOp kIntersect_SkClipOp = SkClipOp::kIntersect; @@ -18,6 +17,5 @@ const SkClipOp kUnion_SkClipOp = SkClipOp::kUnion_private_internal_ const SkClipOp kXOR_SkClipOp = SkClipOp::kXOR_private_internal_do_not_use; const SkClipOp kReverseDifference_SkClipOp = SkClipOp::kReverseDifference_private_internal_do_not_use; const SkClipOp kReplace_SkClipOp = SkClipOp::kReplace_private_internal_do_not_use; -#endif #endif