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).
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);
}
/**
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);
}
/**
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
@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
// 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,
};
#endif
-
-#endif
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
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();
}
int fGenID;
Element(int saveCount) {
- this->initCommon(saveCount, SkClipStackImpl_ReplaceOp, false);
+ this->initCommon(saveCount, SkClipOp::kReplace_private_internal_do_not_use, false);
this->setEmpty();
}
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();
}
/**
#include "SkClipOp.h"
-#ifndef SK_SUPPORT_LEGACY_CLIPOPS_PLAIN_ENUM
const SkClipOp kDifference_SkClipOp = SkClipOp::kDifference;
const SkClipOp kIntersect_SkClipOp = SkClipOp::kIntersect;
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