aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar egdaniel <egdaniel@google.com>2015-05-10 08:45:18 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-10 08:45:18 -0700
commitc19cdc254cc08f334b00c3b9fdb703818c8ca681 (patch)
treeb3c7358359884c80967e8c0f21c9d329d198a987 /include
parentffb3f6817d2ec141fcb5e267a30ecb32010ed8f1 (diff)
Only discard for XP dstCopies if we have a coverage value.
TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1125283005
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrXferProcessor.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h
index 7c07b8027d..812ce5c64c 100644
--- a/include/gpu/GrXferProcessor.h
+++ b/include/gpu/GrXferProcessor.h
@@ -164,11 +164,11 @@ public:
* A caller who calls this function on a XP is required to honor the returned OptFlags
* and color values for its draw.
*/
- virtual OptFlags getOptimizations(const GrProcOptInfo& colorPOI,
- const GrProcOptInfo& coveragePOI,
- bool doesStencilWrite,
- GrColor* overrideColor,
- const GrDrawTargetCaps& caps) = 0;
+ OptFlags getOptimizations(const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ bool doesStencilWrite,
+ GrColor* overrideColor,
+ const GrDrawTargetCaps& caps);
/**
* Returns whether this XP will require an Xfer barrier on the given rt. If true, outBarrierType
@@ -217,6 +217,11 @@ public:
return fDstCopyTextureOffset;
}
+ /**
+ * Returns whether or not the XP will look at coverage when doing its blending.
+ */
+ bool readsCoverage() const { return fReadsCoverage; }
+
/**
* Returns whether or not this xferProcossor will set a secondary output to be used with dual
* source blending.
@@ -237,6 +242,9 @@ public:
if (this->fWillReadDstColor != that.fWillReadDstColor) {
return false;
}
+ if (this->fReadsCoverage != that.fReadsCoverage) {
+ return false;
+ }
if (this->fDstCopy.getTexture() != that.fDstCopy.getTexture()) {
return false;
}
@@ -251,6 +259,12 @@ protected:
GrXferProcessor(const GrDeviceCoordTexture* dstCopy, bool willReadDstColor);
private:
+ virtual OptFlags onGetOptimizations(const GrProcOptInfo& colorPOI,
+ const GrProcOptInfo& coveragePOI,
+ bool doesStencilWrite,
+ GrColor* overrideColor,
+ const GrDrawTargetCaps& caps) = 0;
+
/**
* Sets a unique key on the GrProcessorKeyBuilder that is directly associated with this xfer
* processor's GL backend implementation.
@@ -278,6 +292,7 @@ private:
virtual bool onIsEqual(const GrXferProcessor&) const = 0;
bool fWillReadDstColor;
+ bool fReadsCoverage;
SkIPoint fDstCopyTextureOffset;
GrTextureAccess fDstCopy;