Skia
2DGraphicsLibrary
|
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 SkPath & | getPath () const |
Call if getType() is kRRect to get the round-rect. | |
const SkRRect & | getRRect () const |
Call if getType() is kRect to get the rect. | |
const SkRect & | getRect () 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 SkRRect & | asRRect () 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 SkRect & | getBounds () 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< SkPath > | fPath |
SkRRect | fRRect |
int | fSaveCount |
SkRegion::Op | fOp |
Type | fType |
bool | fDoAA |
SkClipStack::BoundsType | fFiniteBoundType |
SkRect | fFiniteBound |
bool | fIsIntersectionOfRects |
int | fGenID |
Friends | |
class | SkClipStack |
|
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.
|
inline |
Gets the bounds of the clip element, either the rect or path bounds.
(Whether the shape is inverse filled is not considered.)
|
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.
|
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.