Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: include/gpu/GrXferProcessor.h

Issue 787233003: Add XP to handle the cases where we disable color write. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/effects/GrPorterDuffXferProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « gyp/gpu.gypi ('k') | include/gpu/effects/GrPorterDuffXferProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698