| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 const GrGLSLCaps* GrGLProgramBuilder::glslCaps() const { | 69 const GrGLSLCaps* GrGLProgramBuilder::glslCaps() const { |
| 70 return fGpu->ctxInfo().caps()->glslCaps(); | 70 return fGpu->ctxInfo().caps()->glslCaps(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 static GrSLType get_sampler_type(const GrTextureAccess& access) { | 73 static GrSLType get_sampler_type(const GrTextureAccess& access) { |
| 74 GrGLTexture* glTexture = static_cast<GrGLTexture*>(access.getTexture()); | 74 GrGLTexture* glTexture = static_cast<GrGLTexture*>(access.getTexture()); |
| 75 if (glTexture->target() == GR_GL_TEXTURE_EXTERNAL) { | 75 if (glTexture->target() == GR_GL_TEXTURE_EXTERNAL) { |
| 76 return kSamplerExternal_GrSLType; | 76 return kSamplerExternal_GrSLType; |
| 77 } else if (glTexture->target() == GR_GL_TEXTURE_RECTANGLE) { |
| 78 return kSampler2DRect_GrSLType; |
| 77 } else { | 79 } else { |
| 78 SkASSERT(glTexture->target() == GR_GL_TEXTURE_2D); | 80 SkASSERT(glTexture->target() == GR_GL_TEXTURE_2D); |
| 79 return kSampler2D_GrSLType; | 81 return kSampler2D_GrSLType; |
| 80 } | 82 } |
| 81 } | 83 } |
| 82 | 84 |
| 83 void GrGLProgramBuilder::emitSamplers(const GrProcessor& processor, | 85 void GrGLProgramBuilder::emitSamplers(const GrProcessor& processor, |
| 84 GrGLSLTextureSampler::TextureSamplerArray*
outSamplers) { | 86 GrGLSLTextureSampler::TextureSamplerArray*
outSamplers) { |
| 85 int numTextures = processor.numTextures(); | 87 int numTextures = processor.numTextures(); |
| 86 UniformHandle* localSamplerUniforms = fSamplerUniforms.push_back_n(numTextur
es); | 88 UniformHandle* localSamplerUniforms = fSamplerUniforms.push_back_n(numTextur
es); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 fUniformHandles, | 267 fUniformHandles, |
| 266 programID, | 268 programID, |
| 267 fUniformHandler.fUniforms, | 269 fUniformHandler.fUniforms, |
| 268 fVaryingHandler.fPathProcVaryingInfos, | 270 fVaryingHandler.fPathProcVaryingInfos, |
| 269 fGeometryProcessor, | 271 fGeometryProcessor, |
| 270 fXferProcessor, | 272 fXferProcessor, |
| 271 fFragmentProcessors, | 273 fFragmentProcessors, |
| 272 &fSamplerUniforms); | 274 &fSamplerUniforms); |
| 273 } | 275 } |
| 274 | 276 |
| OLD | NEW |