Flutter Engine
The Flutter Engine
|
#include <SkClipStack.h>
Classes | |
class | AutoRestore |
class | B2TIter |
class | Element |
class | Iter |
Public Types | |
enum | BoundsType { kNormal_BoundsType , kInsideOut_BoundsType } |
Public Member Functions | |
SkClipStack () | |
SkClipStack (void *storage, size_t size) | |
SkClipStack (const SkClipStack &b) | |
~SkClipStack () | |
SkClipStack & | operator= (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=nullptr) const |
SkRect | bounds (const SkIRect &deviceBounds) const |
bool | isEmpty (const SkIRect &deviceBounds) const |
bool | quickContains (const SkRect &devRect) const |
bool | quickContains (const SkRRect &devRRect) const |
void | clipDevRect (const SkIRect &ir, SkClipOp op) |
void | clipRect (const SkRect &, const SkMatrix &matrix, SkClipOp, bool doAA) |
void | clipRRect (const SkRRect &, const SkMatrix &matrix, SkClipOp, bool doAA) |
void | clipPath (const SkPath &, const SkMatrix &matrix, SkClipOp, bool doAA) |
void | clipShader (sk_sp< SkShader >) |
void | clipEmpty () |
void | replaceClip (const SkRect &devRect, bool doAA) |
bool | isWideOpen () const |
bool | isRRect (const SkRect &bounds, SkRRect *rrect, bool *aa) const |
uint32_t | getTopmostGenID () const |
void | getConservativeBounds (int offsetX, int offsetY, int maxWidth, int maxHeight, SkRect *devBounds, bool *isIntersectionOfRects=nullptr) const |
Static Public Attributes | |
static const uint32_t | kInvalidGenID = 0 |
static const uint32_t | kEmptyGenID = 1 |
static const uint32_t | kWideOpenGenID = 2 |
Friends | |
class | Iter |
Definition at line 33 of file SkClipStack.h.
Enumerator | |
---|---|
kNormal_BoundsType | |
kInsideOut_BoundsType |
Definition at line 35 of file SkClipStack.h.
SkClipStack::SkClipStack | ( | ) |
Definition at line 510 of file SkClipStack.cpp.
SkClipStack::SkClipStack | ( | void * | storage, |
size_t | size | ||
) |
Definition at line 515 of file SkClipStack.cpp.
SkClipStack::SkClipStack | ( | const SkClipStack & | b | ) |
Definition at line 520 of file SkClipStack.cpp.
SkClipStack::~SkClipStack | ( | ) |
Definition at line 525 of file SkClipStack.cpp.
Definition at line 601 of file SkClipStack.cpp.
Definition at line 344 of file SkClipStack.h.
void SkClipStack::clipEmpty | ( | ) |
Definition at line 773 of file SkClipStack.cpp.
Definition at line 757 of file SkClipStack.cpp.
Definition at line 752 of file SkClipStack.cpp.
void SkClipStack::clipRRect | ( | const SkRRect & | rrect, |
const SkMatrix & | matrix, | ||
SkClipOp | op, | ||
bool | doAA | ||
) |
Definition at line 747 of file SkClipStack.cpp.
Definition at line 763 of file SkClipStack.cpp.
void SkClipStack::getBounds | ( | SkRect * | canvFiniteBound, |
BoundsType * | boundType, | ||
bool * | isIntersectionOfRects = nullptr |
||
) | 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.
Definition at line 615 of file SkClipStack.cpp.
void SkClipStack::getConservativeBounds | ( | int | offsetX, |
int | offsetY, | ||
int | maxWidth, | ||
int | maxHeight, | ||
SkRect * | devBounds, | ||
bool * | isIntersectionOfRects = nullptr |
||
) | 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.
Definition at line 846 of file SkClipStack.cpp.
|
inline |
Definition at line 290 of file SkClipStack.h.
uint32_t SkClipStack::getTopmostGenID | ( | ) | const |
Definition at line 941 of file SkClipStack.cpp.
bool SkClipStack::isEmpty | ( | const SkIRect & | deviceBounds | ) | const |
Definition at line 613 of file SkClipStack.cpp.
This method quickly and conservatively determines whether the entire stack is equivalent to intersection with a rrect given a bounds, where the rrect must not contain the entire bounds.
bounds | A bounds on what will be drawn through the clip. The clip only need be equivalent to a intersection with a rrect for draws within the bounds. The returned rrect must intersect the bounds but need not be contained by the bounds. |
rrect | If return is true rrect will contain the rrect equivalent to the stack. |
aa | If return is true aa will indicate whether the equivalent rrect clip is antialiased. |
Definition at line 874 of file SkClipStack.cpp.
|
inline |
isWideOpen returns true if the clip state corresponds to the infinite plane (i.e., draws are not limited at all)
Definition at line 362 of file SkClipStack.h.
|
inline |
Definition at line 286 of file SkClipStack.h.
SkClipStack & SkClipStack::operator= | ( | const SkClipStack & | b | ) |
Definition at line 529 of file SkClipStack.cpp.
bool SkClipStack::operator== | ( | const SkClipStack & | b | ) | const |
Definition at line 546 of file SkClipStack.cpp.
|
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.
Definition at line 336 of file SkClipStack.h.
|
inline |
Definition at line 340 of file SkClipStack.h.
void SkClipStack::replaceClip | ( | const SkRect & | devRect, |
bool | doAA | ||
) |
Definition at line 768 of file SkClipStack.cpp.
void SkClipStack::reset | ( | ) |
Definition at line 569 of file SkClipStack.cpp.
void SkClipStack::restore | ( | ) |
Definition at line 585 of file SkClipStack.cpp.
void SkClipStack::save | ( | ) |
Definition at line 581 of file SkClipStack.cpp.
|
friend |
Definition at line 489 of file SkClipStack.h.
|
static |
Definition at line 386 of file SkClipStack.h.
|
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.
Definition at line 383 of file SkClipStack.h.
|
static |
Definition at line 387 of file SkClipStack.h.