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 "GrGLSLFragmentShaderBuilder.h" | 8 #include "GrGLSLFragmentShaderBuilder.h" |
9 #include "GrRenderTarget.h" | 9 #include "GrRenderTarget.h" |
10 #include "glsl/GrGLSL.h" | 10 #include "glsl/GrGLSL.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } else if (const char* extension = glslCaps->fragCoordConventionsExtensionSt
ring()) { | 122 } else if (const char* extension = glslCaps->fragCoordConventionsExtensionSt
ring()) { |
123 if (!fSetupFragPosition) { | 123 if (!fSetupFragPosition) { |
124 if (glslCaps->generation() < k150_GrGLSLGeneration) { | 124 if (glslCaps->generation() < k150_GrGLSLGeneration) { |
125 this->addFeature(1 << kFragCoordConventions_GLSLPrivateFeature, | 125 this->addFeature(1 << kFragCoordConventions_GLSLPrivateFeature, |
126 extension); | 126 extension); |
127 } | 127 } |
128 fInputs.push_back().set(kVec4f_GrSLType, | 128 fInputs.push_back().set(kVec4f_GrSLType, |
129 GrGLSLShaderVar::kIn_TypeModifier, | 129 GrGLSLShaderVar::kIn_TypeModifier, |
130 "gl_FragCoord", | 130 "gl_FragCoord", |
131 kDefault_GrSLPrecision, | 131 kDefault_GrSLPrecision, |
132 GrGLSLShaderVar::kUpperLeft_Origin); | 132 "origin_upper_left"); |
133 fSetupFragPosition = true; | 133 fSetupFragPosition = true; |
134 } | 134 } |
135 return "gl_FragCoord"; | 135 return "gl_FragCoord"; |
136 } else { | 136 } else { |
137 static const char* kTempName = "tmpXYFragCoord"; | 137 static const char* kTempName = "tmpXYFragCoord"; |
138 static const char* kCoordName = "fragCoordYDown"; | 138 static const char* kCoordName = "fragCoordYDown"; |
139 if (!fSetupFragPosition) { | 139 if (!fSetupFragPosition) { |
140 const char* rtHeightName; | 140 const char* rtHeightName; |
141 | 141 |
142 fProgramBuilder->addRTHeightUniform("RTHeight", &rtHeightName); | 142 fProgramBuilder->addRTHeightUniform("RTHeight", &rtHeightName); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 249 } |
250 | 250 |
251 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() { | 251 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() { |
252 SkASSERT(fSubstageIndices.count() >= 2); | 252 SkASSERT(fSubstageIndices.count() >= 2); |
253 fSubstageIndices.pop_back(); | 253 fSubstageIndices.pop_back(); |
254 fSubstageIndices.back()++; | 254 fSubstageIndices.back()++; |
255 int removeAt = fMangleString.findLastOf('_'); | 255 int removeAt = fMangleString.findLastOf('_'); |
256 fMangleString.remove(removeAt, fMangleString.size() - removeAt); | 256 fMangleString.remove(removeAt, fMangleString.size() - removeAt); |
257 } | 257 } |
258 | 258 |
OLD | NEW |