Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkClipStack Class Reference
Inheritance diagram for SkClipStack:
SkNVRefCnt< SkClipStack >

Classes

class  B2TIter
 The B2TIter iterates from the bottom of the stack to the top. More...
 
class  Element
 
class  Iter
 

Public Types

enum  BoundsType { kNormal_BoundsType, kInsideOut_BoundsType }
 

Public Member Functions

 SkClipStack (const SkClipStack &b)
 
 SkClipStack (const SkRect &r)
 
 SkClipStack (const SkIRect &r)
 
SkClipStackoperator= (const SkClipStack &b)
 
bool operator== (const SkClipStack &b) const
 
bool operator!= (const SkClipStack &b) const
 
void reset ()
 
int getSaveCount () const
 
void save ()
 
void restore ()
 
void getBounds (SkRect *canvFiniteBound, BoundsType *boundType, bool *isIntersectionOfRects=NULL) const
 getBounds places the current finite bound in its first parameter. More...
 
bool quickContains (const SkRect &devRect) const
 Returns true if the input (r)rect in device space is entirely contained by the clip. More...
 
bool quickContains (const SkRRect &devRRect) const
 
bool asPath (SkPath *path) const
 Flattens the clip stack into a single SkPath. More...
 
void clipDevRect (const SkIRect &ir, SkRegion::Op op)
 
void clipDevRect (const SkRect &, SkRegion::Op, bool doAA)
 
void clipDevRRect (const SkRRect &, SkRegion::Op, bool doAA)
 
void clipDevPath (const SkPath &, SkRegion::Op, bool doAA)
 
void clipEmpty ()
 
bool isWideOpen () const
 isWideOpen returns true if the clip state corresponds to the infinite plane (i.e., draws are not limited at all)
 
int32_t getTopmostGenID () const
 
void dump () const
 Dumps the contents of the clip stack to SkDebugf. More...
 
void getConservativeBounds (int offsetX, int offsetY, int maxWidth, int maxHeight, SkRect *devBounds, bool *isIntersectionOfRects=NULL) const
 GetConservativeBounds returns a conservative bound of the current clip. More...
 
- Public Member Functions inherited from SkNVRefCnt< SkClipStack >
bool unique () const
 
void ref () const
 
void unref () const
 
void deref () const
 

Static Public Attributes

static const int32_t kInvalidGenID = 0
 The generation ID has three reserved values to indicate special (potentially ignorable) cases. More...
 
static const int32_t kEmptyGenID = 1
 
static const int32_t kWideOpenGenID = 2
 

Private Member Functions

bool internalQuickContains (const SkRect &devRect) const
 
bool internalQuickContains (const SkRRect &devRRect) const
 
void pushElement (const Element &element)
 Helper for clipDevPath, etc.
 
void restoreTo (int saveCount)
 Restore the stack back to the specified save count.
 

Static Private Member Functions

static int32_t GetNextGenID ()
 Return the next unique generation ID.
 

Private Attributes

SkDeque fDeque
 
int fSaveCount
 

Static Private Attributes

static int32_t gGenID
 

Friends

class Iter
 

Member Function Documentation

bool SkClipStack::asPath ( SkPath path) const

Flattens the clip stack into a single SkPath.

Returns true if any of the clip stack components requires anti-aliasing.

void SkClipStack::dump ( ) const

Dumps the contents of the clip stack to SkDebugf.

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

void SkClipStack::getBounds ( SkRect canvFiniteBound,
BoundsType *  boundType,
bool *  isIntersectionOfRects = NULL 
) const

getBounds places the current finite bound in its first parameter.

In its second, it indicates which kind of bound is being returned. If 'canvFiniteBound' is a normal bounding box then it encloses all writeable pixels. If 'canvFiniteBound' is an inside out bounding box then it encloses all the un-writeable pixels and the true/normal bound is the infinite plane. isIntersectionOfRects is an optional parameter that is true if 'canvFiniteBound' resulted from an intersection of rects.

void SkClipStack::getConservativeBounds ( int  offsetX,
int  offsetY,
int  maxWidth,
int  maxHeight,
SkRect devBounds,
bool *  isIntersectionOfRects = NULL 
) const

GetConservativeBounds returns a conservative bound of the current clip.

Since this could be the infinite plane (if inverse fills were involved) the maxWidth and maxHeight parameters can be used to limit the returned bound to the expected drawing area. Similarly, the offsetX and offsetY parameters allow the caller to offset the returned bound to account for translated drawing areas (i.e., those resulting from a saveLayer). For finite bounds, the translation (+offsetX, +offsetY) is applied before the clamp to the maximum rectangle: [0,maxWidth) x [0,maxHeight). isIntersectionOfRects is an optional parameter that is true when 'devBounds' is the result of an intersection of rects. In this case 'devBounds' is the exact answer/clip.

bool SkClipStack::quickContains ( const SkRect devRect) const
inline

Returns true if the input (r)rect in device space is entirely contained by the clip.

A return value of false does not guarantee that the (r)rect is not contained by the clip.

Member Data Documentation

const int32_t SkClipStack::kInvalidGenID = 0
static

The generation ID has three reserved values to indicate special (potentially ignorable) cases.

Invalid id that is never returned by SkClipStack. Useful when caching clips based on GenID.


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