Create xfer processor backend.

This includes:
-Having an actual XP stage at the end of the gl pipeline.
-All Blending work is handled by XP until actually setting GL blend states
-GLPrograms test to test XP

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4dffc940c430eec66d4707490eace19c9b3f7904

Review URL: https://codereview.chromium.org/764643004
diff --git a/src/gpu/GrOptDrawState.cpp b/src/gpu/GrOptDrawState.cpp
index 409305c..b4c1a60 100644
--- a/src/gpu/GrOptDrawState.cpp
+++ b/src/gpu/GrOptDrawState.cpp
@@ -44,7 +44,8 @@
                                                    drawState.isColorWriteDisabled(),
                                                    drawState.getStencil().doesWrite(),
                                                    &fColor,
-                                                   &fCoverage);
+                                                   &fCoverage,
+                                                   caps);
     }
 
     // When path rendering the stencil settings are not always set on the draw state
@@ -56,9 +57,6 @@
         // indicate that this can be skipped.
         fFlags = 0;
         fDrawFace = GrDrawState::kInvalid_DrawFace;
-        fSrcBlend = kZero_GrBlendCoeff;
-        fDstBlend = kZero_GrBlendCoeff;
-        fBlendConstant = 0x0;
         fViewMatrix.reset();
         return;
     }
@@ -108,9 +106,6 @@
 
     GrXferProcessor::BlendInfo blendInfo;
     fXferProcessor->getBlendInfo(&blendInfo);
-    fSrcBlend = blendInfo.fSrcBlend;
-    fDstBlend = blendInfo.fDstBlend;
-    fBlendConstant = blendInfo.fBlendConstant;
 
     this->adjustProgramFromOptimizations(drawState, optFlags, colorPOI, coveragePOI,
                                          &firstColorStageIdx, &firstCoverageStageIdx);
@@ -146,42 +141,6 @@
         init.fCoverage = this->getCoverage();
         fGeometryProcessor->initBatchTracker(&fBatchTracker, init);
     }
-
-    this->setOutputStateInfo(drawState, coverageColor, optFlags, caps);
-}
-
-void GrOptDrawState::setOutputStateInfo(const GrDrawState& ds,
-                                        GrColor coverage,
-                                        GrXferProcessor::OptFlags optFlags,
-                                        const GrDrawTargetCaps& caps) {
-    // Set this default and then possibly change our mind if there is coverage.
-    fDescInfo.fPrimaryOutputType = GrProgramDesc::kModulate_PrimaryOutputType;
-    fDescInfo.fSecondaryOutputType = GrProgramDesc::kNone_SecondaryOutputType;
-
-    // Determine whether we should use dual source blending or shader code to keep coverage
-    // separate from color.
-    bool keepCoverageSeparate = !(optFlags & GrXferProcessor::kSetCoverageDrawing_OptFlag);
-    if (keepCoverageSeparate && !ds.hasSolidCoverage(coverage)) {
-        if (caps.dualSourceBlendingSupport()) {
-            if (kZero_GrBlendCoeff == fDstBlend) {
-                // write the coverage value to second color
-                fDescInfo.fSecondaryOutputType = GrProgramDesc::kCoverage_SecondaryOutputType;
-                fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff;
-            } else if (kSA_GrBlendCoeff == fDstBlend) {
-                // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
-                fDescInfo.fSecondaryOutputType = GrProgramDesc::kCoverageISA_SecondaryOutputType;
-                fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff;
-            } else if (kSC_GrBlendCoeff == fDstBlend) {
-                // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
-                fDescInfo.fSecondaryOutputType = GrProgramDesc::kCoverageISC_SecondaryOutputType;
-                fDstBlend = (GrBlendCoeff)GrGpu::kIS2C_GrBlendCoeff;
-            }
-        } else if (fDescInfo.fReadsDst &&
-                   kOne_GrBlendCoeff == fSrcBlend &&
-                   kZero_GrBlendCoeff == fDstBlend) {
-            fDescInfo.fPrimaryOutputType = GrProgramDesc::kCombineWithDst_PrimaryOutputType;
-        }
-    }
 }
 
 void GrOptDrawState::adjustProgramFromOptimizations(const GrDrawState& ds,
@@ -237,10 +196,7 @@
         this->fNumColorStages != that.fNumColorStages ||
         this->fScissorState != that.fScissorState ||
         !this->fViewMatrix.cheapEqualTo(that.fViewMatrix) ||
-        this->fSrcBlend != that.fSrcBlend ||
-        this->fDstBlend != that.fDstBlend ||
         this->fDrawType != that.fDrawType ||
-        this->fBlendConstant != that.fBlendConstant ||
         this->fFlags != that.fFlags ||
         this->fStencilSettings != that.fStencilSettings ||
         this->fDrawFace != that.fDrawFace ||
@@ -262,6 +218,10 @@
         return false;
     }
 
+    if (!this->getXferProcessor()->isEqual(*that.getXferProcessor())) {
+        return false;
+    }
+
     // The program desc comparison should have already assured that the stage counts match.
     SkASSERT(this->numFragmentStages() == that.numFragmentStages());
     for (int i = 0; i < this->numFragmentStages(); i++) {