OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef GrGLSLFragmentShaderBuilder_DEFINED | 8 #ifndef GrGLSLFragmentShaderBuilder_DEFINED |
9 #define GrGLSLFragmentShaderBuilder_DEFINED | 9 #define GrGLSLFragmentShaderBuilder_DEFINED |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 static const char* DeclaredSecondaryColorOutputName() { return "fsSecondaryC
olorOut"; } | 162 static const char* DeclaredSecondaryColorOutputName() { return "fsSecondaryC
olorOut"; } |
163 | 163 |
164 /* | 164 /* |
165 * An internal call for GrGLProgramBuilder to use to add varyings to the ver
tex shader | 165 * An internal call for GrGLProgramBuilder to use to add varyings to the ver
tex shader |
166 */ | 166 */ |
167 void addVarying(GrGLSLVarying*, GrSLPrecision); | 167 void addVarying(GrGLSLVarying*, GrSLPrecision); |
168 | 168 |
169 void onFinalize() override; | 169 void onFinalize() override; |
170 | 170 |
171 /** | 171 /** |
172 * Features that should only be enabled by GrGLSLFragmentShaderBuilder itsel
f. | 172 * Features that should only be enabled by GrGLSLFragmentShaderBuilder itsel
f |
| 173 * or its subclass. |
173 */ | 174 */ |
174 enum GLSLPrivateFeature { | 175 enum GLSLPrivateFeature { |
175 kFragCoordConventions_GLSLPrivateFeature = kLastGLSLFeature + 1, | 176 kFragCoordConventions_GLSLPrivateFeature = kLastGLSLFeature + 1, |
176 kBlendEquationAdvanced_GLSLPrivateFeature, | 177 kBlendEquationAdvanced_GLSLPrivateFeature, |
177 kBlendFuncExtended_GLSLPrivateFeature, | 178 kBlendFuncExtended_GLSLPrivateFeature, |
178 kExternalTexture_GLSLPrivateFeature, | 179 kExternalTexture_GLSLPrivateFeature, |
179 kLastGLSLPrivateFeature = kBlendFuncExtended_GLSLPrivateFeature | 180 kRectangleTexture_GLSLPrivateFeature, |
| 181 kLastGLSLPrivateFeature = kRectangleTexture_GLSLPrivateFeature |
180 }; | 182 }; |
181 | 183 |
182 // Interpretation of FragPosKey when generating code | 184 // Interpretation of FragPosKey when generating code |
183 enum { | 185 enum { |
184 kNoFragPosRead_FragPosKey = 0, // The fragment positition wil
l not be needed. | 186 kNoFragPosRead_FragPosKey = 0, // The fragment positition wil
l not be needed. |
185 kTopLeftFragPosRead_FragPosKey = 0x1,// Read frag pos relative to t
op-left. | 187 kTopLeftFragPosRead_FragPosKey = 0x1,// Read frag pos relative to t
op-left. |
186 kBottomLeftFragPosRead_FragPosKey = 0x2,// Read frag pos relative to b
ottom-left. | 188 kBottomLeftFragPosRead_FragPosKey = 0x2,// Read frag pos relative to b
ottom-left. |
187 }; | 189 }; |
188 | 190 |
189 static const char* kDstTextureColorName; | 191 static const char* kDstTextureColorName; |
190 | 192 |
191 bool fSetupFragPosition; | 193 bool fSetupFragPosition; |
192 bool fTopLeftFragPosRead; | 194 bool fTopLeftFragPosRead; |
193 int fCustomColorOutputIndex; | 195 int fCustomColorOutputIndex; |
194 | 196 |
195 // some state to verify shaders and effects are consistent, this is reset be
tween effects by | 197 // some state to verify shaders and effects are consistent, this is reset be
tween effects by |
196 // the program creator | 198 // the program creator |
197 bool fHasReadDstColor; | 199 bool fHasReadDstColor; |
198 bool fHasReadFragmentPosition; | 200 bool fHasReadFragmentPosition; |
199 | 201 |
200 friend class GrGLSLProgramBuilder; | 202 friend class GrGLSLProgramBuilder; |
201 friend class GrGLProgramBuilder; | 203 friend class GrGLProgramBuilder; |
202 | 204 |
203 typedef GrGLSLXPFragmentBuilder INHERITED; | 205 typedef GrGLSLXPFragmentBuilder INHERITED; |
204 }; | 206 }; |
205 | 207 |
206 #endif | 208 #endif |
OLD | NEW |