OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "gl/GrGLShaderBuilder.h" | 8 #include "gl/GrGLShaderBuilder.h" |
9 #include "gl/GrGLProgram.h" | 9 #include "gl/GrGLProgram.h" |
10 #include "gl/GrGLUniformHandle.h" | 10 #include "gl/GrGLUniformHandle.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 , fSetupFragPosition(false) | 104 , fSetupFragPosition(false) |
105 , fTopLeftFragPosRead(kTopLeftFragPosRead_FragPosKey == desc.getHeader().fFr
agPosKey) | 105 , fTopLeftFragPosRead(kTopLeftFragPosRead_FragPosKey == desc.getHeader().fFr
agPosKey) |
106 , fNumTexGenUnits(0) { | 106 , fNumTexGenUnits(0) { |
107 | 107 |
108 const GrGLProgramDesc::KeyHeader& header = desc.getHeader(); | 108 const GrGLProgramDesc::KeyHeader& header = desc.getHeader(); |
109 | 109 |
110 // We only go without a vertex shader if every effect supports vertexless mo
de, the context | 110 // We only go without a vertex shader if every effect supports vertexless mo
de, the context |
111 // has fixed function/path rendering support, and position is the only verte
x attribute. | 111 // has fixed function/path rendering support, and position is the only verte
x attribute. |
112 if (hasVertexShaderEffects || | 112 if (hasVertexShaderEffects || |
113 !ctxInfo.caps()->fixedFunctionSupport() || | 113 !ctxInfo.caps()->fixedFunctionSupport() || |
114 !ctxInfo.caps()->pathStencilingSupport() || | 114 !ctxInfo.caps()->pathRenderingSupport() || |
115 -1 != header.fLocalCoordAttributeIndex || | 115 -1 != header.fLocalCoordAttributeIndex || |
116 -1 != header.fColorAttributeIndex || | 116 -1 != header.fColorAttributeIndex || |
117 -1 != header.fCoverageAttributeIndex) { | 117 -1 != header.fCoverageAttributeIndex) { |
118 fVertexBuilder.reset(SkNEW_ARGS(VertexBuilder, (this, desc))); | 118 fVertexBuilder.reset(SkNEW_ARGS(VertexBuilder, (this, desc))); |
119 } | 119 } |
120 | 120 |
121 // Emit code to read the dst copy textue if necessary. | 121 // Emit code to read the dst copy textue if necessary. |
122 if (kNoDstRead_DstReadKey != header.fDstReadKey && | 122 if (kNoDstRead_DstReadKey != header.fDstReadKey && |
123 GrGLCaps::kNone_FBFetchType == ctxInfo.caps()->fbFetchType()) { | 123 GrGLCaps::kNone_FBFetchType == ctxInfo.caps()->fbFetchType()) { |
124 bool topDown = SkToBool(kTopLeftOrigin_DstReadKeyBit & header.fDstReadKe
y); | 124 bool topDown = SkToBool(kTopLeftOrigin_DstReadKeyBit & header.fDstReadKe
y); |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 for (const AttributePair* attrib = this->getEffectAttributes().begin(); | 729 for (const AttributePair* attrib = this->getEffectAttributes().begin(); |
730 attrib != attribEnd; | 730 attrib != attribEnd; |
731 ++attrib) { | 731 ++attrib) { |
732 if (attrib->fIndex == attributeIndex) { | 732 if (attrib->fIndex == attributeIndex) { |
733 return &attrib->fName; | 733 return &attrib->fName; |
734 } | 734 } |
735 } | 735 } |
736 | 736 |
737 return NULL; | 737 return NULL; |
738 } | 738 } |
OLD | NEW |