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

Side by Side Diff: src/gpu/gl/GrGLProgramDesc.cpp

Issue 14998007: Make GrGLShaderBuilder check whether GrEffect advertised that it would require the dst color or frag (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Address comments Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawState.h ('k') | src/gpu/gl/GrGLShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698