8#ifndef SkClipStack_DEFINED
9#define SkClipStack_DEFINED
76 this->initRect(0, rect, m, op, doAA);
80 this->initRRect(0, rrect, m, op, doAA);
84 this->initPath(0, path, m, op, doAA);
88 this->initShader(0, std::move(shader));
92 this->initReplaceRect(0, rect, doAA);
109 return *fDeviceSpacePath;
115 return fDeviceSpaceRRect;
121 (fDeviceSpaceRRect.
isRect() || fDeviceSpaceRRect.
isEmpty()));
130 return fShader.
get();
145 return fDeviceSpaceRRect;
150 bool isAA()
const {
return fDoAA; }
218 bool fIsIntersectionOfRects;
227 this->initRRect(saveCount, rrect, m, op, doAA);
231 this->initRect(saveCount, rect, m, op, doAA);
235 this->initPath(saveCount, path, m, op, doAA);
239 this->initShader(saveCount, std::move(shader));
243 this->initReplaceRect(saveCount, rect, doAA);
246 void initCommon(
int saveCount,
SkClipOp op,
bool doAA);
252 void initReplaceRect(
int saveCount,
const SkRect&,
bool doAA);
257 inline void checkEmpty()
const;
258 inline bool canBeIntersectedInPlace(
int saveCount,
SkClipOp op)
const;
262 bool rectRectIntersectAllowed(
const SkRect& newR,
bool newAA)
const;
265 void updateBoundAndGenID(
const Element* prior);
269 kPrev_InvCur_FillCombo,
270 kInvPrev_Cur_FillCombo,
271 kInvPrev_InvCur_FillCombo
274 inline void combineBoundsDiff(FillCombo combination,
const SkRect& prevFinite);
275 inline void combineBoundsIntersection(
int combination,
const SkRect& prevFinite);
311 const int fSaveCount;
325 bool* isIntersectionOfRects =
nullptr)
const;
336 return this->
isWideOpen() || this->internalQuickContains(devRect);
340 return this->
isWideOpen() || this->internalQuickContains(devRRect);
464 using INHERITED =
Iter;
485 bool* isIntersectionOfRects =
nullptr)
const;
493 bool internalQuickContains(
const SkRect& devRect)
const;
494 bool internalQuickContains(
const SkRRect& devRRect)
const;
499 void pushElement(
const Element& element);
504 void restoreTo(
int saveCount);
509 static uint32_t GetNextGenID();
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
Type::kYUV Type::kRGBA() int(0.7 *637)
AutoRestore(SkClipStack *cs, bool doSave)
B2TIter(const SkClipStack &stack)
void reset(const SkClipStack &stack)
bool operator!=(const Element &element) const
Call to get the type of the clip element.
sk_sp< SkShader > refShader() const
Element(sk_sp< SkShader > shader)
Element(const SkRect &rect, bool doAA)
Element(const SkRect &rect, const SkMatrix &m, SkClipOp op, bool doAA)
const SkShader * getShader() const
@ kPath
This element does not have geometry, but applies a shader to the clip.
@ kEmpty
This element makes the clip empty (regardless of previous elements).
@ kRect
This element combines a device space round-rect with the current clip.
@ kRRect
This element combines a device space path with the current clip.
uint32_t getGenID() const
const SkRect & getDeviceSpaceRect() const
Call if getDeviceSpaceType() is kShader to get a reference to the clip shader.
bool isAA() const
Inverts the fill of the clip shape. Note that a kEmpty element remains kEmpty.
void invertShapeFillType()
static const int kTypeCnt
int getSaveCount() const
Call if getDeviceSpaceType() is kPath to get the path.
const SkRRect & getDeviceSpaceRRect() const
Call if getDeviceSpaceType() is kRect to get the rect.
bool isInverseFilled() const
DeviceSpaceType getDeviceSpaceType() const
Call to get the save count associated with this clip element.
Element(const SkRRect &rrect, const SkMatrix &m, SkClipOp op, bool doAA)
const SkPath & getDeviceSpacePath() const
Call if getDeviceSpaceType() is kRRect to get the round-rect.
bool operator==(const Element &element) const
const SkRRect & asDeviceSpaceRRect() const
const SkRect & getBounds() const
bool contains(const SkRect &rect) const
Element(const SkPath &path, const SkMatrix &m, SkClipOp op, bool doAA)
bool isReplaceOp() const
Call to get the element as a path, regardless of its type.
void asDeviceSpacePath(SkPath *path) const
Call if getType() is not kPath to get the element as a round rect.
void reset(const SkClipStack &stack, IterStart startLoc)
const Element * skipToTopmost(SkClipOp op)
void clipRect(const SkRect &, const SkMatrix &matrix, SkClipOp, bool doAA)
void clipShader(sk_sp< SkShader >)
bool isRRect(const SkRect &bounds, SkRRect *rrect, bool *aa) const
bool quickContains(const SkRRect &devRRect) const
static const uint32_t kEmptyGenID
void clipRRect(const SkRRect &, const SkMatrix &matrix, SkClipOp, bool doAA)
bool quickContains(const SkRect &devRect) const
void getBounds(SkRect *canvFiniteBound, BoundsType *boundType, bool *isIntersectionOfRects=nullptr) const
bool isEmpty(const SkIRect &deviceBounds) const
void clipDevRect(const SkIRect &ir, SkClipOp op)
void getConservativeBounds(int offsetX, int offsetY, int maxWidth, int maxHeight, SkRect *devBounds, bool *isIntersectionOfRects=nullptr) const
bool operator==(const SkClipStack &b) const
SkClipStack & operator=(const SkClipStack &b)
uint32_t getTopmostGenID() const
static const uint32_t kInvalidGenID
static const uint32_t kWideOpenGenID
bool operator!=(const SkClipStack &b) const
void clipPath(const SkPath &, const SkMatrix &matrix, SkClipOp, bool doAA)
SkRect bounds(const SkIRect &deviceBounds) const
void replaceClip(const SkRect &devRect, bool doAA)
static const SkMatrix & I()
bool isInverseFillType() const
const SkRect & getBounds() const
void set(const SkIRect &src)