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

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

Issue 554833002: Calculate Primary and Secondary output types in the GrOptDrawState (Closed) Base URL: https://skia.googlesource.com/skia.git@optReadDst
Patch Set: Rebase Created 6 years, 3 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 | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.cpp
diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
index c0a9e13ed19ca4eddf30e6cd283886dc82da5ab0..5339937c1a8e0be49b32e02c2e3193ab6d8e40de 100644
--- a/src/gpu/gl/GrGLProgramDesc.cpp
+++ b/src/gpu/gl/GrGLProgramDesc.cpp
@@ -343,51 +343,14 @@ bool GrGLProgramDesc::Build(const GrOptDrawState& optState,
header->fCoverageAttributeIndex = -1;
}
- // Here we deal with whether/how we handle color and coverage separately.
-
- // Set this default and then possibly change our mind if there is coverage.
- header->fCoverageOutput = kModulate_CoverageOutput;
-
- // If we do have coverage determine whether it matters.
- bool separateCoverageFromColor = optState.hasGeometryProcessor();
- if (!optState.isCoverageDrawing() &&
- (optState.numCoverageStages() > 0 ||
- optState.hasGeometryProcessor() ||
- requiresCoverageAttrib)) {
-
- if (gpu->caps()->dualSourceBlendingSupport()) {
- if (kZero_GrBlendCoeff == dstCoeff) {
- // write the coverage value to second color
- header->fCoverageOutput = kSecondaryCoverage_CoverageOutput;
- separateCoverageFromColor = true;
- } else if (kSA_GrBlendCoeff == dstCoeff) {
- // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
- header->fCoverageOutput = kSecondaryCoverageISA_CoverageOutput;
- separateCoverageFromColor = true;
- } else if (kSC_GrBlendCoeff == dstCoeff) {
- // SA dst coeff becomes 1-(1-SA)*coverage when dst is partially covered.
- header->fCoverageOutput = kSecondaryCoverageISC_CoverageOutput;
- separateCoverageFromColor = true;
- }
- } else if (optState.readsDst() &&
- kOne_GrBlendCoeff == srcCoeff &&
- kZero_GrBlendCoeff == dstCoeff) {
- header->fCoverageOutput = kCombineWithDst_CoverageOutput;
- separateCoverageFromColor = true;
- }
- }
+ header->fPrimaryOutputType = optState.getPrimaryOutputType();
+ header->fSecondaryOutputType = optState.getSecondaryOutputType();
for (int s = 0; s < optState.numColorStages(); ++s) {
colorStages->push_back(&optState.getColorStage(s));
}
- SkTArray<const GrEffectStage*, true>* array;
- if (separateCoverageFromColor) {
- array = coverageStages;
- } else {
- array = colorStages;
- }
for (int s = 0; s < optState.numCoverageStages(); ++s) {
- array->push_back(&optState.getCoverageStage(s));
+ coverageStages->push_back(&optState.getCoverageStage(s));
}
header->fColorEffectCnt = colorStages->count();
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGpuGL_program.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698