| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "GrGLProgramDesc.h" | 8 #include "GrGLProgramDesc.h" |
| 9 #include "GrBackendEffectFactory.h" | 9 #include "GrBackendEffectFactory.h" |
| 10 #include "GrDrawEffect.h" | 10 #include "GrDrawEffect.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 for (int s = 0; s < GrDrawState::kNumStages; ++s) { | 81 for (int s = 0; s < GrDrawState::kNumStages; ++s) { |
| 82 | 82 |
| 83 bool skip = s < drawState.getFirstCoverageStage() ? skipColor : skipCove
rage; | 83 bool skip = s < drawState.getFirstCoverageStage() ? skipColor : skipCove
rage; |
| 84 if (!skip && drawState.isStageEnabled(s)) { | 84 if (!skip && drawState.isStageEnabled(s)) { |
| 85 lastEnabledStage = s; | 85 lastEnabledStage = s; |
| 86 const GrEffectRef& effect = *drawState.getStage(s).getEffect(); | 86 const GrEffectRef& effect = *drawState.getStage(s).getEffect(); |
| 87 const GrBackendEffectFactory& factory = effect->getFactory(); | 87 const GrBackendEffectFactory& factory = effect->getFactory(); |
| 88 GrDrawEffect drawEffect(drawState.getStage(s), requiresLocalCoordAtt
rib); | 88 GrDrawEffect drawEffect(drawState.getStage(s), requiresLocalCoordAtt
rib); |
| 89 desc->fEffectKeys[s] = factory.glEffectKey(drawEffect, gpu->glCaps()
); | 89 desc->fEffectKeys[s] = factory.glEffectKey(drawEffect, gpu->glCaps()
); |
| 90 if (effect->willReadDst()) { | 90 if (effect->willReadDstColor()) { |
| 91 readsDst = true; | 91 readsDst = true; |
| 92 } | 92 } |
| 93 } else { | 93 } else { |
| 94 desc->fEffectKeys[s] = 0; | 94 desc->fEffectKeys[s] = 0; |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 if (readsDst) { | 98 if (readsDst) { |
| 99 GrAssert(NULL != dstCopy || gpu->caps()->dstReadInShaderSupport()); | 99 GrAssert(NULL != dstCopy || gpu->caps()->dstReadInShaderSupport()); |
| 100 const GrTexture* dstCopyTexture = NULL; | 100 const GrTexture* dstCopyTexture = NULL; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 if (requiresCoverageAttrib) { | 192 if (requiresCoverageAttrib) { |
| 193 desc->fCoverageAttributeIndex = drawState.coverageVertexAttributeIndex()
; | 193 desc->fCoverageAttributeIndex = drawState.coverageVertexAttributeIndex()
; |
| 194 } else if (GrGLProgramDesc::kAttribute_ColorInput == desc->fCoverageInput) { | 194 } else if (GrGLProgramDesc::kAttribute_ColorInput == desc->fCoverageInput) { |
| 195 GrAssert(availableAttributeIndex < GrDrawState::kMaxVertexAttribCnt); | 195 GrAssert(availableAttributeIndex < GrDrawState::kMaxVertexAttribCnt); |
| 196 desc->fCoverageAttributeIndex = availableAttributeIndex; | 196 desc->fCoverageAttributeIndex = availableAttributeIndex; |
| 197 } else { | 197 } else { |
| 198 desc->fCoverageAttributeIndex = -1; | 198 desc->fCoverageAttributeIndex = -1; |
| 199 } | 199 } |
| 200 } | 200 } |
| OLD | NEW |