GrClips know their device dimensions
If GrClips know their dimensions then getConservativeBounds() does not
need any arguments and isRRect() can remove its rtBounds argument.
I also updated GrFixedClip to report the render target bounds as a
degenerate rrect in its isRRect implementation if it was wide open. Its
apply() function was also simplified to take advantage of the prior
GrScissorState work where the rectangle was always valid to access and
contained within the render target bounds.
Change-Id: I627b97976cb176b1c80627462027034b06ad2cb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290957
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp
index 49f91b7..d9727ad 100644
--- a/src/gpu/GrRenderTargetContext.cpp
+++ b/src/gpu/GrRenderTargetContext.cpp
@@ -701,8 +701,7 @@
}
static SkIRect get_clip_bounds(const GrRenderTargetContext* rtc, const GrClip* clip) {
- return clip ? clip->getConservativeBounds(rtc->width(), rtc->height())
- : SkIRect::MakeWH(rtc->width(), rtc->height());
+ return clip ? clip->getConservativeBounds() : SkIRect::MakeWH(rtc->width(), rtc->height());
}
GrRenderTargetContext::QuadOptimization GrRenderTargetContext::attemptQuadOptimization(
@@ -761,7 +760,7 @@
GrAA clipAA = stencilSettings ? *aa : GrAA::kNo;
bool axisAlignedClip = true;
if (clip && !clip->quickContains(rtRect)) {
- if (!clip->isRRect(rtRect, &clipRRect, &clipAA)) {
+ if (!clip->isRRect(&clipRRect, &clipAA)) {
axisAlignedClip = false;
}
}
@@ -1079,8 +1078,7 @@
GrAppliedHardClip appliedClip(fRenderTargetContext->dimensions(),
fRenderTargetContext->asSurfaceProxy()->backingStoreDimensions());
- if (clip && !clip->apply(fRenderTargetContext->width(), fRenderTargetContext->height(),
- &appliedClip, &bounds)) {
+ if (clip && !clip->apply(&appliedClip, &bounds)) {
return;
}
// else see FIXME above; we'd normally want to check path bounds with render target bounds,