24 virtual bool quickContains(
const SkRect&)
const = 0;
25 virtual bool quickContains(
const SkRRect& rrect)
const {
26 return this->quickContains(rrect.getBounds());
28 virtual void getConservativeBounds(
int width,
int height,
SkIRect* devResult,
29 bool* isIntersectionOfRects =
nullptr)
const = 0;
31 GrAppliedClip* out)
const = 0;
50 template<
typename TRect> constexpr
static bool IsInsideClip(
const TRect& innerClipBounds,
51 const SkRect& queryBounds) {
66 template<
typename TRect> constexpr
static bool IsOutsideClip(
const TRect& outerClipBounds,
67 const SkRect& queryBounds) {
80 return SkIRect::MakeLTRB(SkScalarFloorToInt(bounds.fLeft +
kBoundsTolerance),
90 return SkRect::MakeLTRB(SkScalarFloorToScalar(bounds.fLeft +
kBoundsTolerance),
100 return SkScalarAbs(SkScalarRoundToScalar(rect.fLeft) - rect.fLeft) <=
kBoundsTolerance &&
101 SkScalarAbs(SkScalarRoundToScalar(rect.fTop) - rect.fTop) <=
kBoundsTolerance &&
102 SkScalarAbs(SkScalarRoundToScalar(rect.fRight) - rect.fRight) <=
kBoundsTolerance &&
103 SkScalarAbs(SkScalarRoundToScalar(rect.fBottom) - rect.fBottom) <=
kBoundsTolerance;
112 bool quickContains(
const SkRect&)
const final {
115 void getConservativeBounds(
int width,
int height,
SkIRect* devResult,
116 bool* isIntersectionOfRects)
const final {
117 devResult->setXYWH(0, 0, width, height);
118 if (isIntersectionOfRects) {
119 *isIntersectionOfRects =
true;
static SkRect GetPixelBounds(const SkRect &bounds)
Returns the minimal pixel-aligned rect that counts as containing a given set of bounds.
Definition: GrClip.h:89
The SkRRect class represents a rounded rect with a potentially different radii for each corner...
Definition: SkRRect.h:48
static constexpr bool IsInsideClip(const TRect &innerClipBounds, const SkRect &queryBounds)
Returns true if the given query bounds count as entirely inside the clip.
Definition: GrClip.h:50
GrClip is an abstract base class for applying a clip.
Definition: GrClip.h:22
static constexpr SkScalar kBoundsTolerance
This is the maximum distance that a draw may extend beyond a clip's boundary and still count count as...
Definition: GrClip.h:42
Definition: GrDrawContext.h:51
Specialized implementation for no clip.
Definition: GrClip.h:110
Definition: GrContext.h:48
static SkIRect GetPixelIBounds(const SkRect &bounds)
Returns the minimal integer rect that counts as containing a given set of bounds. ...
Definition: GrClip.h:79
static constexpr bool IsOutsideClip(const TRect &outerClipBounds, const SkRect &queryBounds)
Returns true if the given query bounds count as entirely outside the clip.
Definition: GrClip.h:66
SkIRect holds four 32 bit integer coordinates for a rectangle.
Definition: SkRect.h:20
static bool IsPixelAligned(const SkRect &rect)
Returns true if the given rect counts as aligned with pixel boundaries.
Definition: GrClip.h:99