| 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 "GrGLProgramBuilder.h" | 8 #include "GrGLProgramBuilder.h" |
| 9 | 9 |
| 10 #include "GrAutoLocaleSetter.h" | 10 #include "GrAutoLocaleSetter.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 int numTextures = processor.numTextures(); | 85 int numTextures = processor.numTextures(); |
| 86 UniformHandle* localSamplerUniforms = fSamplerUniforms.push_back_n(numTextur
es); | 86 UniformHandle* localSamplerUniforms = fSamplerUniforms.push_back_n(numTextur
es); |
| 87 SkString name; | 87 SkString name; |
| 88 for (int t = 0; t < numTextures; ++t) { | 88 for (int t = 0; t < numTextures; ++t) { |
| 89 name.printf("Sampler%d", t); | 89 name.printf("Sampler%d", t); |
| 90 GrSLType samplerType = get_sampler_type(processor.textureAccess(t)); | 90 GrSLType samplerType = get_sampler_type(processor.textureAccess(t)); |
| 91 localSamplerUniforms[t] = | 91 localSamplerUniforms[t] = |
| 92 fUniformHandler.addUniform(GrGLSLUniformHandler::kFragment_Visibilit
y, | 92 fUniformHandler.addUniform(GrGLSLUniformHandler::kFragment_Visibilit
y, |
| 93 samplerType, kDefault_GrSLPrecision, | 93 samplerType, kDefault_GrSLPrecision, |
| 94 name.c_str()); | 94 name.c_str()); |
| 95 SkNEW_APPEND_TO_TARRAY(outSamplers, GrGLSLTextureSampler, | 95 outSamplers->emplace_back(localSamplerUniforms[t], processor.textureAcce
ss(t)); |
| 96 (localSamplerUniforms[t], processor.textureAccess
(t))); | |
| 97 if (kSamplerExternal_GrSLType == samplerType) { | 96 if (kSamplerExternal_GrSLType == samplerType) { |
| 98 const char* externalFeatureString = this->glslCaps()->externalTextur
eExtensionString(); | 97 const char* externalFeatureString = this->glslCaps()->externalTextur
eExtensionString(); |
| 99 // We shouldn't ever create a GrGLTexture that requires external sam
pler type | 98 // We shouldn't ever create a GrGLTexture that requires external sam
pler type |
| 100 SkASSERT(externalFeatureString); | 99 SkASSERT(externalFeatureString); |
| 101 fFS.addFeature(1 << GrGLSLFragmentShaderBuilder::kExternalTexture_GL
SLPrivateFeature, | 100 fFS.addFeature(1 << GrGLSLFragmentShaderBuilder::kExternalTexture_GL
SLPrivateFeature, |
| 102 externalFeatureString); | 101 externalFeatureString); |
| 103 } | 102 } |
| 104 } | 103 } |
| 105 } | 104 } |
| 106 | 105 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 fUniformHandles, | 264 fUniformHandles, |
| 266 programID, | 265 programID, |
| 267 fUniformHandler.fUniforms, | 266 fUniformHandler.fUniforms, |
| 268 fVaryingHandler.fPathProcVaryingInfos, | 267 fVaryingHandler.fPathProcVaryingInfos, |
| 269 fGeometryProcessor, | 268 fGeometryProcessor, |
| 270 fXferProcessor, | 269 fXferProcessor, |
| 271 fFragmentProcessors, | 270 fFragmentProcessors, |
| 272 &fSamplerUniforms); | 271 &fSamplerUniforms); |
| 273 } | 272 } |
| 274 | 273 |
| OLD | NEW |