diff options
author | 2014-12-22 07:35:52 -0800 | |
---|---|---|
committer | 2014-12-22 07:35:52 -0800 | |
commit | 080e673b10ac607305f140ddb245e140ccde40c6 (patch) | |
tree | c8e51428edeeb5fff1075c68a3a408e1f2f0110b /include/gpu/GrXferProcessor.h | |
parent | ebc11635e40ccf2a34fb1cdbc9dec635cb3d74d8 (diff) |
Add XP to handle the cases where we disable color write.
BUG=skia:
Review URL: https://codereview.chromium.org/787233003
Diffstat (limited to 'include/gpu/GrXferProcessor.h')
-rw-r--r-- | include/gpu/GrXferProcessor.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h index 98585c6a53..2c9961fc6b 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; |