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

Unified Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 14233006: Perform coverage blend with the dst in the shader when using a dst-reading xfermode. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 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
Index: src/gpu/gl/GrGLProgramDesc.cpp
===================================================================
--- src/gpu/gl/GrGLProgramDesc.cpp (revision 8756)
+++ src/gpu/gl/GrGLProgramDesc.cpp (working copy)
@@ -103,7 +103,7 @@
desc->fDstRead = 0;
}
- desc->fDualSrcOutput = kNone_DualSrcOutput;
+ desc->fCoverageOutput = kModulate_CoverageOutput;
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything
// other than pass through values from the VS to the FS anyway).
@@ -151,17 +151,22 @@
GrDrawState::kCoverageAsAlpha_BlendOptFlag))) {
if (kZero_GrBlendCoeff == dstCoeff) {
// write the coverage value to second color
- desc->fDualSrcOutput = kCoverage_DualSrcOutput;
+ desc->fCoverageOutput = kSecondaryCoverage_CoverageOutput;
desc->fFirstCoverageStage = firstCoverageStage;
} else if (kSA_GrBlendCoeff == dstCoeff) {
// SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
- desc->fDualSrcOutput = kCoverageISA_DualSrcOutput;
+ desc->fCoverageOutput = kSecondaryCoverageISA_CoverageOutput;
desc->fFirstCoverageStage = firstCoverageStage;
} else if (kSC_GrBlendCoeff == dstCoeff) {
// SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
- desc->fDualSrcOutput = kCoverageISC_DualSrcOutput;
+ desc->fCoverageOutput = kSecondaryCoverageISC_CoverageOutput;
desc->fFirstCoverageStage = firstCoverageStage;
}
+ } else if (readsDst &&
+ kOne_GrBlendCoeff == drawState.getSrcBlendCoeff() &&
+ kZero_GrBlendCoeff == drawState.getDstBlendCoeff()) {
+ desc->fCoverageOutput = kCombineWithDst_CoverageOutput;
+ desc->fFirstCoverageStage = firstCoverageStage;
}
}

Powered by Google App Engine
This is Rietveld 408576698