Skia
2DGraphicsLibrary
|
GrClip is an abstract base class for applying a clip. More...
#include <GrClip.h>
Public Member Functions | |
virtual bool | quickContains (const SkRect &) const =0 |
virtual bool | quickContains (const SkRRect &rrect) const |
virtual void | getConservativeBounds (int width, int height, SkIRect *devResult, bool *isIntersectionOfRects=nullptr) const =0 |
virtual bool | apply (GrContext *, GrDrawContext *, bool useHWAA, bool hasUserStencilSettings, GrAppliedClip *out) const =0 |
Static Public Member Functions | |
template<typename TRect > | |
static constexpr bool | IsInsideClip (const TRect &innerClipBounds, const SkRect &queryBounds) |
Returns true if the given query bounds count as entirely inside the clip. More... | |
template<typename TRect > | |
static constexpr bool | IsOutsideClip (const TRect &outerClipBounds, const SkRect &queryBounds) |
Returns true if the given query bounds count as entirely outside the clip. More... | |
static SkIRect | GetPixelIBounds (const SkRect &bounds) |
Returns the minimal integer rect that counts as containing a given set of bounds. | |
static SkRect | GetPixelBounds (const SkRect &bounds) |
Returns the minimal pixel-aligned rect that counts as containing a given set of bounds. | |
static bool | IsPixelAligned (const SkRect &rect) |
Returns true if the given rect counts as aligned with pixel boundaries. | |
Static Public Attributes | |
static constexpr SkScalar | kBoundsTolerance = 1e-3f |
This is the maximum distance that a draw may extend beyond a clip's boundary and still count count as "on the other side". More... | |
GrClip is an abstract base class for applying a clip.
It constructs a clip mask if necessary, and fills out a GrAppliedClip instructing the caller on how to set up the draw state.
|
inlinestatic |
|
inlinestatic |
|
static |
This is the maximum distance that a draw may extend beyond a clip's boundary and still count count as "on the other side".
We leave some slack because floating point rounding error is likely to blame. The rationale for 1e-3 is that in the coverage case (and barring unexpected rounding), as long as coverage stays within 0.5 * 1/256 of its intended value it shouldn't have any effect on the final pixel values.