| Index: src/gpu/gl/GrGLProgramDesc.cpp
|
| diff --git a/src/gpu/gl/GrGLProgramDesc.cpp b/src/gpu/gl/GrGLProgramDesc.cpp
|
| index 8b731fbc2c71244e80a6f6dc87262280e31e214a..afa3f1df9b3e56e57c4ecbc902dfd3dbd049d4a6 100644
|
| --- a/src/gpu/gl/GrGLProgramDesc.cpp
|
| +++ b/src/gpu/gl/GrGLProgramDesc.cpp
|
| @@ -70,10 +70,11 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
|
|
|
| bool colorIsTransBlack = SkToBool(blendOpts & GrDrawState::kEmitTransBlack_BlendOptFlag);
|
| bool colorIsSolidWhite = (blendOpts & GrDrawState::kEmitCoverage_BlendOptFlag) ||
|
| - (!requiresColorAttrib && 0xffffffff == drawState.getColor());
|
| + (!requiresColorAttrib && 0xffffffff == drawState.getColor()) ||
|
| + (drawState.effectiveColorStageCount() > 0 && !(*drawState.getEffectiveColorStage(0).getEffect())->willUseInputColor());
|
|
|
| - int numEffects = (skipColor ? 0 : drawState.numColorStages()) +
|
| - (skipCoverage ? 0 : drawState.numCoverageStages());
|
| + int numEffects = (skipColor ? 0 : drawState.effectiveColorStageCount()) +
|
| + (skipCoverage ? 0 : drawState.effectiveCoverageStageCount());
|
|
|
| size_t newKeyLength = KeyLength(numEffects);
|
| bool allocChanged;
|
| @@ -93,17 +94,17 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
|
| bool readFragPosition = false;
|
| bool hasVertexCode = false;
|
| if (!skipColor) {
|
| - for (int s = 0; s < drawState.numColorStages(); ++s) {
|
| + for (int s = 0; s < drawState.effectiveColorStageCount(); ++s) {
|
| effectKeys[currEffectKey++] =
|
| - get_key_and_update_stats(drawState.getColorStage(s), gpu->glCaps(),
|
| + get_key_and_update_stats(drawState.getEffectiveColorStage(s), gpu->glCaps(),
|
| requiresLocalCoordAttrib, &readsDst, &readFragPosition,
|
| &hasVertexCode);
|
| }
|
| }
|
| if (!skipCoverage) {
|
| - for (int s = 0; s < drawState.numCoverageStages(); ++s) {
|
| + for (int s = 0; s < drawState.effectiveCoverageStageCount(); ++s) {
|
| effectKeys[currEffectKey++] =
|
| - get_key_and_update_stats(drawState.getCoverageStage(s), gpu->glCaps(),
|
| + get_key_and_update_stats(drawState.getEffectiveCoverageStage(s), gpu->glCaps(),
|
| requiresLocalCoordAttrib, &readsDst, &readFragPosition,
|
| &hasVertexCode);
|
| }
|
| @@ -111,7 +112,6 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
|
|
|
| header->fHasVertexCode = hasVertexCode || requiresLocalCoordAttrib;
|
| header->fEmitsPointSize = isPoints;
|
| - header->fColorFilterXfermode = skipColor ? SkXfermode::kDst_Mode : drawState.getColorFilterMode();
|
|
|
| // 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).
|
| @@ -199,12 +199,7 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
|
| // If we do have coverage determine whether it matters.
|
| bool separateCoverageFromColor = false;
|
| if (!drawState.isCoverageDrawing() && !skipCoverage &&
|
| - (drawState.numCoverageStages() > 0 || requiresCoverageAttrib)) {
|
| - // color filter is applied between color/coverage computation
|
| - if (SkXfermode::kDst_Mode != header->fColorFilterXfermode) {
|
| - separateCoverageFromColor = true;
|
| - }
|
| -
|
| + (drawState.effectiveCoverageStageCount() > 0 || requiresCoverageAttrib)) {
|
| // If we're stenciling then we want to discard samples that have zero coverage
|
| if (drawState.getStencil().doesWrite()) {
|
| header->fDiscardIfZeroCoverage = true;
|
| @@ -235,22 +230,22 @@ void GrGLProgramDesc::Build(const GrDrawState& drawState,
|
| }
|
| }
|
| if (!skipColor) {
|
| - for (int s = 0; s < drawState.numColorStages(); ++s) {
|
| - colorStages->push_back(&drawState.getColorStage(s));
|
| + for (int s = 0; s < drawState.effectiveColorStageCount(); ++s) {
|
| + colorStages->push_back(&drawState.getEffectiveColorStage(s));
|
| }
|
| - header->fColorEffectCnt = drawState.numColorStages();
|
| + header->fColorEffectCnt = drawState.effectiveColorStageCount();
|
| }
|
| if (!skipCoverage) {
|
| SkTArray<const GrEffectStage*, true>* array;
|
| if (separateCoverageFromColor) {
|
| array = coverageStages;
|
| - header->fCoverageEffectCnt = drawState.numCoverageStages();
|
| + header->fCoverageEffectCnt = drawState.effectiveCoverageStageCount();
|
| } else {
|
| array = colorStages;
|
| - header->fColorEffectCnt += drawState.numCoverageStages();
|
| + header->fColorEffectCnt += drawState.effectiveCoverageStageCount();
|
| }
|
| - for (int s = 0; s < drawState.numCoverageStages(); ++s) {
|
| - array->push_back(&drawState.getCoverageStage(s));
|
| + for (int s = 0; s < drawState.effectiveCoverageStageCount(); ++s) {
|
| + array->push_back(&drawState.getEffectiveCoverageStage(s));
|
| }
|
| }
|
|
|
|
|