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 #include "GrGLFragmentShaderBuilder.h" | 8 #include "GrGLFragmentShaderBuilder.h" |
9 #include "GrGLShaderStringBuilder.h" | 9 #include "GrGLShaderStringBuilder.h" |
10 #include "GrGLProgramBuilder.h" | 10 #include "GrGLProgramBuilder.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 "1.0);\n", kCoordName, rtHeightName); | 188 "1.0);\n", kCoordName, rtHeightName); |
189 fSetupFragPosition = true; | 189 fSetupFragPosition = true; |
190 } | 190 } |
191 SkASSERT(fProgramBuilder->fUniformHandles.fRTHeightUni.isValid()); | 191 SkASSERT(fProgramBuilder->fUniformHandles.fRTHeightUni.isValid()); |
192 return kCoordName; | 192 return kCoordName; |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 void GrGLFragmentShaderBuilder::addVarying(GrSLType type, | 196 void GrGLFragmentShaderBuilder::addVarying(GrSLType type, |
197 const char* name, | 197 const char* name, |
198 const char** fsInName) { | 198 const char** fsInName, |
199 fInputs.push_back().set(type, GrGLShaderVar::kVaryingIn_TypeModifier, name); | 199 GrGLShaderVar::Precision fsPrecision) { |
| 200 fInputs.push_back().set(type, GrGLShaderVar::kVaryingIn_TypeModifier, name,
fsPrecision); |
200 if (fsInName) { | 201 if (fsInName) { |
201 *fsInName = name; | 202 *fsInName = name; |
202 } | 203 } |
203 } | 204 } |
204 | 205 |
205 void GrGLFragmentShaderBuilder::bindProgramLocations(GrGLuint programId) { | 206 void GrGLFragmentShaderBuilder::bindProgramLocations(GrGLuint programId) { |
206 GrGpuGL* gpu = fProgramBuilder->gpu(); | 207 GrGpuGL* gpu = fProgramBuilder->gpu(); |
207 if (fHasCustomColorOutput) { | 208 if (fHasCustomColorOutput) { |
208 GL_CALL(BindFragDataLocation(programId, 0, declared_color_output_name())
); | 209 GL_CALL(BindFragDataLocation(programId, 0, declared_color_output_name())
); |
209 } | 210 } |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 dual_source_output_name()); | 343 dual_source_output_name()); |
343 fHasSecondaryOutput = true; | 344 fHasSecondaryOutput = true; |
344 } | 345 } |
345 return dual_source_output_name(); | 346 return dual_source_output_name(); |
346 } | 347 } |
347 | 348 |
348 const char* GrGLFragmentShaderBuilder::getColorOutputName() const { | 349 const char* GrGLFragmentShaderBuilder::getColorOutputName() const { |
349 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor"
; | 350 return fHasCustomColorOutput ? declared_color_output_name() : "gl_FragColor"
; |
350 } | 351 } |
351 | 352 |
OLD | NEW |