Index: include/gpu/GrXferProcessor.h |
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h |
index 98585c6a5374b311ef532b352567c158a26977eb..2c9961fc6b625cc231fd001aa1f9270f00910e69 100644 |
--- a/include/gpu/GrXferProcessor.h |
+++ b/include/gpu/GrXferProcessor.h |
@@ -86,18 +86,19 @@ public: |
* A caller who calls this function on a XP is required to honor the returned OptFlags |
* and color values for its draw. |
*/ |
- // TODO: remove need for colorWriteDisabled once colorWriteDisabled is its own XP. |
virtual OptFlags getOptimizations(const GrProcOptInfo& colorPOI, |
const GrProcOptInfo& coveragePOI, |
- bool colorWriteDisabled, |
bool doesStencilWrite, |
GrColor* overrideColor, |
const GrDrawTargetCaps& caps) = 0; |
struct BlendInfo { |
+ BlendInfo() : fWriteColor(true) {} |
+ |
GrBlendCoeff fSrcBlend; |
GrBlendCoeff fDstBlend; |
GrColor fBlendConstant; |
+ bool fWriteColor; |
}; |
virtual void getBlendInfo(BlendInfo* blendInfo) const = 0; |
@@ -176,9 +177,8 @@ public: |
* certain state information (colorWriteDisabled) to determine whether |
* coverage can be handled correctly. |
*/ |
- // TODO: remove need for colorWriteDisabled once colorWriteDisabled is its own XP. |
- virtual bool canApplyCoverage(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, |
- bool colorWriteDisabled) const = 0; |
+ virtual bool canApplyCoverage(const GrProcOptInfo& colorPOI, |
+ const GrProcOptInfo& coveragePOI) const = 0; |
struct InvariantOutput { |
@@ -192,9 +192,8 @@ public: |
* this xp factory. The invariant color information returned by this function refers to the |
* final color produced after all blending. |
*/ |
- // TODO: remove need for colorWriteDisabled once only XP can read dst. |
virtual void getInvariantOutput(const GrProcOptInfo& colorPOI, const GrProcOptInfo& coveragePOI, |
- bool colorWriteDisabled, InvariantOutput*) const = 0; |
+ InvariantOutput*) const = 0; |
/** |
* Determines whether multiplying the computed per-pixel color by the pixel's fractional |
@@ -203,6 +202,14 @@ public: |
*/ |
virtual bool canTweakAlphaForCoverage() const = 0; |
+ /** |
+ * Returns true if the XP generated by this factory will read dst. |
+ */ |
+ // TODO: Currently this function must also check if the color/coverage stages read dst. |
+ // Once only XP's can read dst we can remove the ProcOptInfo's from this function. |
+ virtual bool willReadDst(const GrProcOptInfo& colorPOI, |
+ const GrProcOptInfo& coveragePOI) const = 0; |
+ |
bool isEqual(const GrXPFactory& that) const { |
if (this->classID() != that.classID()) { |
return false; |