Stop overflow of windows rects in GrClipStack

Bug: skia:10989
Change-Id: I512ccbd3d95178756ae436f7c67ed53d46105ae7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339165
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrClipStack.cpp b/src/gpu/GrClipStack.cpp
index 98de71b..a639511 100644
--- a/src/gpu/GrClipStack.cpp
+++ b/src/gpu/GrClipStack.cpp
@@ -1401,8 +1401,7 @@
                     fullyApplied = e.innerBounds() == e.outerBounds() ||
                                    e.innerBounds().contains(scissorBounds);
                 } else {
-                    if (!e.innerBounds().isEmpty() &&
-                        out->windowRectsState().numWindows() < maxWindowRectangles) {
+                    if (!e.innerBounds().isEmpty() && windowRects.count() < maxWindowRectangles) {
                         // TODO: If we have more difference ops than available window rects, we
                         // should prioritize those with the largest inner bounds.
                         windowRects.addWindow(e.innerBounds());