| 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 17 matching lines...) Expand all Loading... |
| 28 GrGLProgram::GrGLProgram(GrGLGpu* gpu, | 28 GrGLProgram::GrGLProgram(GrGLGpu* gpu, |
| 29 const GrProgramDesc& desc, | 29 const GrProgramDesc& desc, |
| 30 const BuiltinUniformHandles& builtinUniforms, | 30 const BuiltinUniformHandles& builtinUniforms, |
| 31 GrGLuint programID, | 31 GrGLuint programID, |
| 32 const UniformInfoArray& uniforms, | 32 const UniformInfoArray& uniforms, |
| 33 const SeparableVaryingInfoArray& separableVaryings, | 33 const SeparableVaryingInfoArray& separableVaryings, |
| 34 GrGLInstalledGeoProc* geometryProcessor, | 34 GrGLInstalledGeoProc* geometryProcessor, |
| 35 GrGLInstalledXferProc* xferProcessor, | 35 GrGLInstalledXferProc* xferProcessor, |
| 36 GrGLInstalledFragProcs* fragmentProcessors, | 36 GrGLInstalledFragProcs* fragmentProcessors, |
| 37 SkTArray<UniformHandle>* passSamplerUniforms) | 37 SkTArray<UniformHandle>* passSamplerUniforms) |
| 38 : fColor(GrColor_ILLEGAL) | 38 : fBuiltinUniformHandles(builtinUniforms) |
| 39 , fCoverage(0) | |
| 40 , fDstTextureUnit(-1) | |
| 41 , fBuiltinUniformHandles(builtinUniforms) | |
| 42 , fProgramID(programID) | 39 , fProgramID(programID) |
| 43 , fGeometryProcessor(geometryProcessor) | 40 , fGeometryProcessor(geometryProcessor) |
| 44 , fXferProcessor(xferProcessor) | 41 , fXferProcessor(xferProcessor) |
| 45 , fFragmentProcessors(SkRef(fragmentProcessors)) | 42 , fFragmentProcessors(SkRef(fragmentProcessors)) |
| 46 , fDesc(desc) | 43 , fDesc(desc) |
| 47 , fGpu(gpu) | 44 , fGpu(gpu) |
| 48 , fProgramDataManager(gpu, programID, uniforms, separableVaryings) { | 45 , fProgramDataManager(gpu, programID, uniforms, separableVaryings) { |
| 49 fSamplerUniforms.swap(passSamplerUniforms); | 46 fSamplerUniforms.swap(passSamplerUniforms); |
| 50 // Assign texture units to sampler uniforms one time up front. | 47 // Assign texture units to sampler uniforms one time up front. |
| 51 GL_CALL(UseProgram(fProgramID)); | 48 GL_CALL(UseProgram(fProgramID)); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); | 140 fRenderTargetState.getRTAdjustmentVec(rtAdjustmentVec); |
| 144 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni,
1, rtAdjustmentVec); | 141 fProgramDataManager.set4fv(fBuiltinUniformHandles.fRTAdjustmentUni,
1, rtAdjustmentVec); |
| 145 } | 142 } |
| 146 } else { | 143 } else { |
| 147 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); | 144 SkASSERT(fGpu->glCaps().shaderCaps()->pathRenderingSupport()); |
| 148 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); | 145 const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>(); |
| 149 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), | 146 fGpu->glPathRendering()->setProjectionMatrix(pathProc.viewMatrix(), |
| 150 size, rt->origin()); | 147 size, rt->origin()); |
| 151 } | 148 } |
| 152 } | 149 } |
| OLD | NEW |