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

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

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.h
===================================================================
--- src/gpu/gl/GrGLProgramDesc.h (revision 8756)
+++ src/gpu/gl/GrGLProgramDesc.h (working copy)
@@ -65,18 +65,37 @@
kColorInputCnt
};
- // Dual-src blending makes use of a secondary output color that can be
- // used as a per-pixel blend coefficient. This controls whether a
- // secondary source is output and what value it holds.
- enum DualSrcOutput {
- kNone_DualSrcOutput,
- kCoverage_DualSrcOutput,
- kCoverageISA_DualSrcOutput,
- kCoverageISC_DualSrcOutput,
- kDualSrcOutputCnt
+ enum CoverageOutput {
+ // modulate color and coverage, write result as the color output.
+ kModulate_CoverageOutput,
+ // Writes color*coverage as the primary color output and also writes coverage as the
+ // secondary output. Only set if dual source blending is supported.
+ kSecondaryCoverage_CoverageOutput,
+ // Writes color*coverage as the primary color output and also writes coverage * (1 - colorA)
+ // as the secondary output. Only set if dual source blending is supported.
+ kSecondaryCoverageISA_CoverageOutput,
+ // Writes color*coverage as the primary color output and also writes coverage *
+ // (1 - colorRGB) as the secondary output. Only set if dual source blending is supported.
+ kSecondaryCoverageISC_CoverageOutput,
+ // Combines the coverage, dst, and color as coverage * color + (1 - coverage) * dst. This
+ // can only be set if fDstRead is set.
+ kCombineWithDst_CoverageOutput,
+
+ kCoverageOutputCnt
};
+ static bool CoverageOutputUsesSecondaryOutput(CoverageOutput co) {
+ switch (co) {
+ case kSecondaryCoverage_CoverageOutput: // fallthru
+ case kSecondaryCoverageISA_CoverageOutput:
+ case kSecondaryCoverageISC_CoverageOutput:
+ return true;
+ default:
+ return false;
+ }
+ }
+
/** Non-zero if this stage has an effect */
GrGLEffect::EffectKey fEffectKeys[GrDrawState::kNumStages];
@@ -95,7 +114,7 @@
uint8_t fColorInput; // casts to enum ColorInput
uint8_t fCoverageInput; // casts to enum ColorInput
- uint8_t fDualSrcOutput; // casts to enum DualSrcOutput
+ uint8_t fCoverageOutput; // casts to enum CoverageOutput
int8_t fFirstCoverageStage;
SkBool8 fEmitsPointSize;

Powered by Google App Engine
This is Rietveld 408576698