Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkClipStack::Element Class Reference

Public Types

enum  Type {
  kEmpty_Type, kRect_Type, kRRect_Type, kPath_Type,
  kLastType = kPath_Type
}
 

Public Member Functions

 Element (const Element &)
 
 Element (const SkRect &rect, SkRegion::Op op, bool doAA)
 
 Element (const SkRRect &rrect, SkRegion::Op op, bool doAA)
 
 Element (const SkPath &path, SkRegion::Op op, bool doAA)
 
bool operator== (const Element &element) const
 
bool operator!= (const Element &element) const
 Call to get the type of the clip element.
 
Type getType () const
 Call to get the save count associated with this clip element.
 
int getSaveCount () const
 Call if getType() is kPath to get the path.
 
const SkPathgetPath () const
 Call if getType() is kRRect to get the round-rect.
 
const SkRRectgetRRect () const
 Call if getType() is kRect to get the rect.
 
const SkRectgetRect () const
 Call if getType() is not kEmpty to get the set operation used to combine this element.
 
SkRegion::Op getOp () const
 Call to get the element as a path, regardless of its type.
 
void asPath (SkPath *path) const
 Call if getType() is not kPath to get the element as a round rect.
 
const SkRRectasRRect () const
 
bool isAA () const
 If getType() is not kEmpty this indicates whether the clip shape should be anti-aliased when it is rasterized. More...
 
void invertShapeFillType ()
 Sets the set operation represented by the element.
 
void setOp (SkRegion::Op op)
 
int32_t getGenID () const
 The GenID can be used by clip stack clients to cache representations of the clip. More...
 
const SkRectgetBounds () const
 Gets the bounds of the clip element, either the rect or path bounds. More...
 
bool contains (const SkRect &rect) const
 Conservatively checks whether the clip shape contains the rect param. More...
 
bool contains (const SkRRect &rrect) const
 
bool isInverseFilled () const
 Is the clip shape inverse filled.
 
void replay (SkCanvasClipVisitor *) const
 Replay this clip into the visitor.
 
void dump () const
 Dumps the element to SkDebugf. More...
 

Static Public Attributes

static const int kTypeCnt = kLastType + 1
 

Private Types

enum  FillCombo { kPrev_Cur_FillCombo, kPrev_InvCur_FillCombo, kInvPrev_Cur_FillCombo, kInvPrev_InvCur_FillCombo }
 

Private Member Functions

 Element (int saveCount)
 
 Element (int saveCount, const SkRRect &rrect, SkRegion::Op op, bool doAA)
 
 Element (int saveCount, const SkRect &rect, SkRegion::Op op, bool doAA)
 
 Element (int saveCount, const SkPath &path, SkRegion::Op op, bool doAA)
 
void initCommon (int saveCount, SkRegion::Op op, bool doAA)
 
void initRect (int saveCount, const SkRect &rect, SkRegion::Op op, bool doAA)
 
void initRRect (int saveCount, const SkRRect &rrect, SkRegion::Op op, bool doAA)
 
void initPath (int saveCount, const SkPath &path, SkRegion::Op op, bool doAA)
 
void setEmpty ()
 
void checkEmpty () const
 
bool canBeIntersectedInPlace (int saveCount, SkRegion::Op op) const
 
bool rectRectIntersectAllowed (const SkRect &newR, bool newAA) const
 
void updateBoundAndGenID (const Element *prior)
 Determines possible finite bounds for the Element given the previous element of the stack.
 
void combineBoundsDiff (FillCombo combination, const SkRect &prevFinite)
 
void combineBoundsXOR (int combination, const SkRect &prevFinite)
 
void combineBoundsUnion (int combination, const SkRect &prevFinite)
 
void combineBoundsIntersection (int combination, const SkRect &prevFinite)
 
void combineBoundsRevDiff (int combination, const SkRect &prevFinite)
 

Private Attributes

SkTLazy< SkPathfPath
 
SkRRect fRRect
 
int fSaveCount
 
SkRegion::Op fOp
 
Type fType
 
bool fDoAA
 
SkClipStack::BoundsType fFiniteBoundType
 
SkRect fFiniteBound
 
bool fIsIntersectionOfRects
 
int fGenID
 

Friends

class SkClipStack
 

Member Enumeration Documentation

Enumerator
kEmpty_Type 

This element makes the clip empty (regardless of previous elements).

This element combines a rect with the current clip using a set operation

kRect_Type 

This element combines a round-rect with the current clip using a set operation.

kRRect_Type 

This element combines a path with the current clip using a set operation.

Member Function Documentation

bool SkClipStack::Element::contains ( const SkRect rect) const
inline

Conservatively checks whether the clip shape contains the rect param.

(Whether the shape is inverse filled is not considered.)

void SkClipStack::Element::dump ( ) const

Dumps the element to SkDebugf.

This is intended for Skia development debugging Don't rely on the existence of this function or the formatting of its output.

const SkRect& SkClipStack::Element::getBounds ( ) const
inline

Gets the bounds of the clip element, either the rect or path bounds.

(Whether the shape is inverse filled is not considered.)

int32_t SkClipStack::Element::getGenID ( ) const
inline

The GenID can be used by clip stack clients to cache representations of the clip.

The ID corresponds to the set of clip elements up to and including this element within the stack not to the element itself. That is the same clip path in different stacks will have a different ID since the elements produce different clip result in the context of their stacks.

bool SkClipStack::Element::isAA ( ) const
inline

If getType() is not kEmpty this indicates whether the clip shape should be anti-aliased when it is rasterized.

Inverts the fill of the clip shape. Note that a kEmpty element remains kEmpty.


The documentation for this class was generated from the following file: