Revert "Lift atlas clip FP creation out of GrClip::apply"
This reverts commit 92b35673c5bb97ffad6f88c3d237db51cdce39bb.
Reason for revert: breaking the android roll (see ag/14076257)
Original change's description:
> Lift atlas clip FP creation out of GrClip::apply
>
> Atlas clips always had a potential point of failure: If the SDC's
> opsTask ever got closed between GrClip::apply and
> GrOpsTask::addDrawOp, their mask would have gotten sent to the wrong
> opsTask. It didn't _look_ like this could happen with the current
> code, but it could have also been inadvertently changed quite easily.
>
> This CL adds a "pathsForClipAtlas" array for GrClip::apply to fill out
> instead of creating FPs. The SDC then generates the actual clip atlas
> FPs once it knows exactly which opsTask they will belong in.
>
> Bug: chromium:928984
> Change-Id: I507ab13b2b5e8c3c3c1916d97611297dbbd8a522
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/389926
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=robertphillips@google.com,csmartdalton@google.com,michaelludwig@google.com,adlai@google.com
Change-Id: I9597d822a9f31b7070aee691ddf3a52f4f424a24
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:928984
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392339
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
diff --git a/src/gpu/GrAppliedClip.h b/src/gpu/GrAppliedClip.h
index 9a8f8b4..e8ccc2d 100644
--- a/src/gpu/GrAppliedClip.h
+++ b/src/gpu/GrAppliedClip.h
@@ -45,9 +45,11 @@
/**
* Intersects the applied clip with the provided rect. Returns false if the draw became empty.
+ * 'clippedDrawBounds' will be intersected with 'irect'. This returns false if the clip becomes
+ * empty or the draw no longer intersects the clip. In either case the draw can be skipped.
*/
- bool SK_WARN_UNUSED_RESULT addScissor(const SkIRect& scissor) {
- return fScissorState.intersect(scissor);
+ bool addScissor(const SkIRect& irect, SkRect* clippedDrawBounds) {
+ return fScissorState.intersect(irect) && clippedDrawBounds->intersect(SkRect::Make(irect));
}
void setScissor(const SkIRect& irect) {