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 "gl/GrGLGpu.h" | 10 #include "gl/GrGLGpu.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 const char* GrGLSLFragmentShaderBuilder::dstColor() { | 169 const char* GrGLSLFragmentShaderBuilder::dstColor() { |
170 fHasReadDstColor = true; | 170 fHasReadDstColor = true; |
171 | 171 |
172 const char* override = fProgramBuilder->primitiveProcessor().getDestColorOve
rride(); | 172 const char* override = fProgramBuilder->primitiveProcessor().getDestColorOve
rride(); |
173 if (override != nullptr) { | 173 if (override != nullptr) { |
174 return override; | 174 return override; |
175 } | 175 } |
176 | 176 |
177 const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps(); | 177 const GrGLSLCaps* glslCaps = fProgramBuilder->glslCaps(); |
178 if (glslCaps->fbFetchSupport()) { | 178 if (glslCaps->fbFetchSupport()) { |
179 this->addFeature(1 << (GrGLSLFragmentShaderBuilder::kLastGLSLPrivateFeat
ure + 1), | 179 this->addFeature(1 << kFramebufferFetch_GLSLPrivateFeature, |
180 glslCaps->fbFetchExtensionString()); | 180 glslCaps->fbFetchExtensionString()); |
181 | 181 |
182 // Some versions of this extension string require declaring custom color
output on ES 3.0+ | 182 // Some versions of this extension string require declaring custom color
output on ES 3.0+ |
183 const char* fbFetchColorName = glslCaps->fbFetchColorName(); | 183 const char* fbFetchColorName = glslCaps->fbFetchColorName(); |
184 if (glslCaps->fbFetchNeedsCustomOutput()) { | 184 if (glslCaps->fbFetchNeedsCustomOutput()) { |
185 this->enableCustomOutput(); | 185 this->enableCustomOutput(); |
186 fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOu
t_TypeModifier); | 186 fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOu
t_TypeModifier); |
187 fbFetchColorName = DeclaredColorOutputName(); | 187 fbFetchColorName = DeclaredColorOutputName(); |
188 } | 188 } |
189 return fbFetchColorName; | 189 return fbFetchColorName; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 272 } |
273 | 273 |
274 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() { | 274 void GrGLSLFragmentBuilder::onAfterChildProcEmitCode() { |
275 SkASSERT(fSubstageIndices.count() >= 2); | 275 SkASSERT(fSubstageIndices.count() >= 2); |
276 fSubstageIndices.pop_back(); | 276 fSubstageIndices.pop_back(); |
277 fSubstageIndices.back()++; | 277 fSubstageIndices.back()++; |
278 int removeAt = fMangleString.findLastOf('_'); | 278 int removeAt = fMangleString.findLastOf('_'); |
279 fMangleString.remove(removeAt, fMangleString.size() - removeAt); | 279 fMangleString.remove(removeAt, fMangleString.size() - removeAt); |
280 } | 280 } |
281 | 281 |
OLD | NEW |