ccpr: Fix debug counters for stencil resolve instances

TBR=robertphillips@google.com

Bug: skia:
Change-Id: I7ddc477b61472549aff047afae51810378534aa4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228838
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.cpp b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
index 96dd894..0a6433c 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.cpp
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.cpp
@@ -275,6 +275,7 @@
     ++specs->fNumRenderedPaths[idx];
     specs->fRenderedPathStats[idx].statPath(path);
     specs->fRenderedAtlasSpecs.accountForSpace(fMaskDevIBounds.width(), fMaskDevIBounds.height());
+    SkDEBUGCODE(fWasCountedAsRender = true);
 }
 
 bool GrCCDrawPathsOp::SingleDraw::shouldCachePathMask(int maxRenderTargetSize) const {
@@ -363,7 +364,7 @@
             resources->appendDrawPathInstance().set(
                     *fCacheEntry, fCachedMaskShift, SkPMColor4f_toFP16(fColor), fillRule);
 #ifdef SK_DEBUG
-            if (fDoCachePathMask) {
+            if (fWasCountedAsRender) {
                 // A path mask didn't exist for this path at the beginning of flush, but we have one
                 // now. What this means is that we've drawn the same path multiple times this flush.
                 // Let the resources know that we reused one for their internal debug counters.
diff --git a/src/gpu/ccpr/GrCCDrawPathsOp.h b/src/gpu/ccpr/GrCCDrawPathsOp.h
index 2b607e1..1499c28 100644
--- a/src/gpu/ccpr/GrCCDrawPathsOp.h
+++ b/src/gpu/ccpr/GrCCDrawPathsOp.h
@@ -118,6 +118,7 @@
         SkIVector fCachedMaskShift;
         bool fDoCopyToA8Coverage = false;
         bool fDoCachePathMask = false;
+        SkDEBUGCODE(bool fWasCountedAsRender = false);
 
         SingleDraw* fNext = nullptr;