Don't use analytic clip FPs when drawing to stencil

It doesn't make sense to multiply by coverage when drawing to stencil.
This could theoretically work with FPs that discard and/or modify
the sample mask, but for the time being an analytic FP means one that
calculates a coverage value.

Bug: skia:7190
Change-Id: Ic40cf6c19c377cba80bad458993582f5cc07022a
Reviewed-on: https://skia-review.googlesource.com/67423
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/gpu/GrReducedClip.cpp b/src/gpu/GrReducedClip.cpp
index bc3286b..d37c83f 100644
--- a/src/gpu/GrReducedClip.cpp
+++ b/src/gpu/GrReducedClip.cpp
@@ -17,6 +17,7 @@
 #include "GrFixedClip.h"
 #include "GrPathRenderer.h"
 #include "GrStencilSettings.h"
+#include "GrStencilClip.h"
 #include "GrStyle.h"
 #include "GrUserStencilSettings.h"
 #include "SkClipOpPriv.h"
@@ -695,52 +696,14 @@
 ////////////////////////////////////////////////////////////////////////////////
 // Create a 1-bit clip mask in the stencil buffer.
 
-class StencilClip final : public GrClip {
-public:
-    StencilClip(const SkIRect& scissorRect, uint32_t clipStackID)
-        : fFixedClip(scissorRect)
-        , fClipStackID(clipStackID) {
-    }
-
-    const GrFixedClip& fixedClip() const { return fFixedClip; }
-
-    void setWindowRectangles(const GrWindowRectangles& windows, GrWindowRectsState::Mode mode) {
-        fFixedClip.setWindowRectangles(windows, mode);
-    }
-
-private:
-    bool quickContains(const SkRect&) const override {
-        return false;
-    }
-    void getConservativeBounds(int width, int height, SkIRect* bounds, bool* iior) const override {
-        fFixedClip.getConservativeBounds(width, height, bounds, iior);
-    }
-    bool isRRect(const SkRect& rtBounds, SkRRect* rr, GrAA*) const override {
-        return false;
-    }
-    bool apply(GrContext* context, GrRenderTargetContext* renderTargetContext, bool useHWAA,
-               bool hasUserStencilSettings, GrAppliedClip* out, SkRect* bounds) const override {
-        if (!fFixedClip.apply(context, renderTargetContext, useHWAA, hasUserStencilSettings, out,
-                              bounds)) {
-            return false;
-        }
-        out->addStencilClip(fClipStackID);
-        return true;
-    }
-
-    GrFixedClip fFixedClip;
-    uint32_t    fClipStackID;
-
-    typedef GrClip INHERITED;
-};
-
 bool GrReducedClip::drawStencilClipMask(GrContext* context,
                                         GrRenderTargetContext* renderTargetContext) const {
     // We set the current clip to the bounds so that our recursive draws are scissored to them.
-    StencilClip stencilClip(fScissor, this->maskGenID());
+    GrStencilClip stencilClip(fScissor, this->maskGenID());
 
     if (!fWindowRects.empty()) {
-        stencilClip.setWindowRectangles(fWindowRects, GrWindowRectsState::Mode::kExclusive);
+        stencilClip.fixedClip().setWindowRectangles(fWindowRects,
+                                                    GrWindowRectsState::Mode::kExclusive);
     }
 
     bool initialState = InitialState::kAllIn == this->initialState();