Remove component flags from GrXPFactory output analysis.

Change-Id: Ieb8dab564e6e593dca2e092d352756052dadfd90
Reviewed-on: https://skia-review.googlesource.com/8354
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h
index 353c682..5aff17f 100644
--- a/include/gpu/GrXferProcessor.h
+++ b/include/gpu/GrXferProcessor.h
@@ -321,24 +321,27 @@
                                          bool hasMixedSamples,
                                          const DstTexture*,
                                          const GrCaps& caps) const;
+
     /**
-     * Known color information after blending, but before accounting for any coverage.
+     * Is the destination color required either in the shader or fixed function blending.
      */
-    struct InvariantBlendedColor {
-        bool                     fWillBlendWithDst;
-        GrColor                  fKnownColor;
-        GrColorComponentFlags    fKnownColorFlags;
-    };
+    static bool WillReadDst(const GrXPFactory*, const GrProcOptInfo& colorInput,
+                            const GrProcOptInfo& coverageInput);
 
-    /** 
-     * Returns information about the output color, produced by XPs from this factory, that will be
-     * known after blending. Note that we can conflate coverage and color, so the actual values
-     * written to pixels with partial coverage may not always seem consistent with the invariant
-     * information returned by this function.
+    /**
+     * Most of the time GrXferProcessor performs a blend of the src and dst colors and then applies
+     * the coverage using c*b + (1-c)*d where c is coverage, b=F(s,d) is the blended color, s is the
+     * source color, and d is the destination color. This query answers the question "is b a
+     * constant and if so what is its value?" If the XP ignores the source color or applies the
+     * coverage in some other fashion then this returns false.
      */
-    virtual void getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
-                                          InvariantBlendedColor*) const = 0;
+    static bool IsPreCoverageBlendedColorConstant(const GrXPFactory*,
+                                                  const GrProcOptInfo& colorInput, GrColor* color);
 
+    /**
+     * This will return true if the xfer processor needs the dst color in the shader and the way
+     * that the color will be made available to the xfer processor is by sampling a texture.
+     */
     bool willNeedDstTexture(const GrCaps& caps, const GrPipelineAnalysis& analysis) const;
 
 protected:
@@ -353,19 +356,27 @@
     }
 
 private:
+    /** Subclass-specific implementation of IsPreCoverageBlendedColorConstant(). */
+    virtual bool isPreCoverageBlendedColorConstant(const GrProcOptInfo& colorInput,
+                                                   GrColor* color) const = 0;
+
+    /** Subclass-specific implementation of WillReadDst(). */
+    virtual bool willReadsDst(const GrProcOptInfo& colorInput,
+                              const GrProcOptInfo& coverageInput) const = 0;
+
     virtual GrXferProcessor* onCreateXferProcessor(const GrCaps& caps,
                                                    const GrPipelineAnalysis&,
                                                    bool hasMixedSamples,
                                                    const DstTexture*) const = 0;
 
-    bool willReadDstColor(const GrCaps& caps, const GrPipelineAnalysis& analysis) const;
+    bool willReadDstInShader(const GrCaps& caps, const GrPipelineAnalysis& analysis) const;
 
     /**
      *  Returns true if the XP generated by this factory will explicitly read dst in the fragment
      *  shader. This will not be called for draws that read from PLS since the dst color is always
      *  available in such draws.
      */
-    virtual bool willReadDstColor(const GrCaps&, ColorType, CoverageType) const = 0;
+    virtual bool willReadDstInShader(const GrCaps&, ColorType, CoverageType) const = 0;
 };
 #if defined(__GNUC__) || defined(__clang)
 #pragma GCC diagnostic pop