Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.
BUG=skia:
Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4
Review URL: https://codereview.chromium.org/759713002
diff --git a/src/gpu/GrOptDrawState.h b/src/gpu/GrOptDrawState.h
index 45501b4..1878d16 100644
--- a/src/gpu/GrOptDrawState.h
+++ b/src/gpu/GrOptDrawState.h
@@ -194,22 +194,20 @@
/**
* Alter the program desc and inputs (attribs and processors) based on the blend optimization.
*/
- void adjustProgramForBlendOpt(const GrDrawState& ds, GrDrawState::BlendOpt,
- int* firstColorStageIdx, int* firstCoverageStageIdx);
-
- /**
- * Loop over the effect stages to determine various info like what data they will read and what
- * shaders they require.
- */
- void getStageStats(const GrDrawState& ds, int firstColorStageIdx, int firstCoverageStageIdx,
- bool hasLocalCoords);
+ void adjustProgramFromOptimizations(const GrDrawState& ds,
+ GrXferProcessor::OptFlags,
+ const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ int* firstColorStageIdx,
+ int* firstCoverageStageIdx);
/**
* Calculates the primary and secondary output types of the shader. For certain output types
* the function may adjust the blend coefficients. After this function is called the src and dst
* blend coeffs will represent those used by backend API.
*/
- void setOutputStateInfo(const GrDrawState& ds, GrDrawState::BlendOpt, const GrDrawTargetCaps&);
+ void setOutputStateInfo(const GrDrawState& ds, GrXferProcessor::OptFlags,
+ const GrDrawTargetCaps&);
enum Flags {
kDither_Flag = 0x1,