| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrGLProgram.h" | 8 #include "GrGLProgram.h" |
| 9 | 9 |
| 10 #include "GrAllocator.h" | 10 #include "GrAllocator.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 const GrPipeline& pipeline, | 104 const GrPipeline& pipeline, |
| 105 int* nextSamplerIdx) { | 105 int* nextSamplerIdx) { |
| 106 GrFragmentProcessor::Iter iter(pipeline); | 106 GrFragmentProcessor::Iter iter(pipeline); |
| 107 GrGLSLFragmentProcessor::Iter glslIter(fFragmentProcessors.begin(), | 107 GrGLSLFragmentProcessor::Iter glslIter(fFragmentProcessors.begin(), |
| 108 fFragmentProcessors.count()); | 108 fFragmentProcessors.count()); |
| 109 const GrFragmentProcessor* fp = iter.next(); | 109 const GrFragmentProcessor* fp = iter.next(); |
| 110 GrGLSLFragmentProcessor* glslFP = glslIter.next(); | 110 GrGLSLFragmentProcessor* glslFP = glslIter.next(); |
| 111 while (fp && glslFP) { | 111 while (fp && glslFP) { |
| 112 glslFP->setData(fProgramDataManager, *fp); | 112 glslFP->setData(fProgramDataManager, *fp); |
| 113 this->bindTextures(*fp, pipeline.getAllowSRGBInputs(), nextSamplerIdx); | 113 this->bindTextures(*fp, pipeline.getAllowSRGBInputs(), nextSamplerIdx); |
| 114 fp = iter.next(), glslFP = glslIter.next(); | 114 fp = iter.next(); |
| 115 glslFP = glslIter.next(); |
| 115 } | 116 } |
| 116 SkASSERT(!fp && !glslFP); | 117 SkASSERT(!fp && !glslFP); |
| 117 } | 118 } |
| 118 | 119 |
| 119 | 120 |
| 120 void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc, | 121 void GrGLProgram::setRenderTargetState(const GrPrimitiveProcessor& primProc, |
| 121 const GrPipeline& pipeline) { | 122 const GrPipeline& pipeline) { |
| 122 // Load the RT height uniform if it is needed to y-flip gl_FragCoord. | 123 // Load the RT height uniform if it is needed to y-flip gl_FragCoord. |
| 123 if (fBuiltinUniformHandles.fRTHeightUni.isValid() && | 124 if (fBuiltinUniformHandles.fRTHeightUni.isValid() && |
| 124 fRenderTargetState.fRenderTargetSize.fHeight != pipeline.getRenderTarget
()->height()) { | 125 fRenderTargetState.fRenderTargetSize.fHeight != pipeline.getRenderTarget
()->height()) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 165 } |
| 165 | 166 |
| 166 void GrGLProgram::generateMipmaps(const GrProcessor& processor, | 167 void GrGLProgram::generateMipmaps(const GrProcessor& processor, |
| 167 bool allowSRGBInputs) { | 168 bool allowSRGBInputs) { |
| 168 for (int i = 0; i < processor.numTextures(); ++i) { | 169 for (int i = 0; i < processor.numTextures(); ++i) { |
| 169 const GrTextureAccess& access = processor.textureAccess(i); | 170 const GrTextureAccess& access = processor.textureAccess(i); |
| 170 fGpu->generateMipmaps(access.getParams(), allowSRGBInputs, | 171 fGpu->generateMipmaps(access.getParams(), allowSRGBInputs, |
| 171 static_cast<GrGLTexture*>(access.getTexture())); | 172 static_cast<GrGLTexture*>(access.getTexture())); |
| 172 } | 173 } |
| 173 } | 174 } |
| OLD | NEW |