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

Unified Diff: include/gpu/GrXferProcessor.h

Issue 1125283005: Only discard for XP dstCopies if we have a coverage value. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up Created 5 years, 7 months 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 | « no previous file | src/effects/SkArithmeticMode_gpu.cpp » ('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 7c07b8027d41593cc4de73e7c37d4afa5e5f6309..812ce5c64cb050372b3bac37a0489a33a23b913c 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;
« no previous file with comments | « no previous file | src/effects/SkArithmeticMode_gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698