| Index: src/gpu/gl/GrGLProgram.cpp
|
| diff --git a/src/gpu/gl/GrGLProgram.cpp b/src/gpu/gl/GrGLProgram.cpp
|
| index 5bc7d0b277a3fecd1a11a385003310793c9d6276..18d007cf2101dea7f2bfa000dae5313b53e0bffa 100644
|
| --- a/src/gpu/gl/GrGLProgram.cpp
|
| +++ b/src/gpu/gl/GrGLProgram.cpp
|
| @@ -25,18 +25,18 @@ GrGLProgram* GrGLProgram::Create(GrGpuGL* gpu,
|
| const GrEffectStage* colorStages[],
|
| const GrEffectStage* coverageStages[]) {
|
| GrGLShaderBuilder::GenProgramOutput output;
|
| - SkAutoTUnref<GrGLUniformManager> uman(SkNEW_ARGS(GrGLUniformManager, (gpu)));
|
| - if (GrGLShaderBuilder::GenProgram(gpu, uman, desc, colorStages, coverageStages,
|
| + SkAutoTUnref<GrGLProgramResourceManager> prman(SkNEW_ARGS(GrGLProgramResourceManager, (gpu)));
|
| + if (GrGLShaderBuilder::GenProgram(gpu, prman, desc, colorStages, coverageStages,
|
| &output)) {
|
| SkASSERT(0 != output.fProgramID);
|
| - return SkNEW_ARGS(GrGLProgram, (gpu, desc, uman, output));
|
| + return SkNEW_ARGS(GrGLProgram, (gpu, desc, prman, output));
|
| }
|
| return NULL;
|
| }
|
|
|
| GrGLProgram::GrGLProgram(GrGpuGL* gpu,
|
| const GrGLProgramDesc& desc,
|
| - GrGLUniformManager* uman,
|
| + GrGLProgramResourceManager* prman,
|
| const GrGLShaderBuilder::GenProgramOutput& builderOutput)
|
| : fColor(GrColor_ILLEGAL)
|
| , fCoverage(GrColor_ILLEGAL)
|
| @@ -44,7 +44,7 @@ GrGLProgram::GrGLProgram(GrGpuGL* gpu,
|
| , fBuilderOutput(builderOutput)
|
| , fDesc(desc)
|
| , fGpu(gpu)
|
| - , fUniformManager(SkRef(uman)) {
|
| + , fProgramResourceManager(SkRef(prman)) {
|
| this->initSamplerUniforms();
|
| }
|
|
|
| @@ -84,11 +84,11 @@ void GrGLProgram::initSamplerUniforms() {
|
| GL_CALL(UseProgram(fBuilderOutput.fProgramID));
|
| GrGLint texUnitIdx = 0;
|
| if (fBuilderOutput.fUniformHandles.fDstCopySamplerUni.isValid()) {
|
| - fUniformManager->setSampler(fBuilderOutput.fUniformHandles.fDstCopySamplerUni, texUnitIdx);
|
| + fProgramResourceManager->setSampler(fBuilderOutput.fUniformHandles.fDstCopySamplerUni, texUnitIdx);
|
| fDstCopyTexUnit = texUnitIdx++;
|
| }
|
| - fBuilderOutput.fColorEffects->initSamplers(*fUniformManager, &texUnitIdx);
|
| - fBuilderOutput.fCoverageEffects->initSamplers(*fUniformManager, &texUnitIdx);
|
| + fBuilderOutput.fColorEffects->initSamplers(*fProgramResourceManager, &texUnitIdx);
|
| + fBuilderOutput.fCoverageEffects->initSamplers(*fProgramResourceManager, &texUnitIdx);
|
| }
|
|
|
| ///////////////////////////////////////////////////////////////////////////////
|
| @@ -119,10 +119,10 @@ void GrGLProgram::setData(GrDrawState::BlendOptFlags blendOpts,
|
|
|
| if (NULL != dstCopy) {
|
| if (fBuilderOutput.fUniformHandles.fDstCopyTopLeftUni.isValid()) {
|
| - fUniformManager->set2f(fBuilderOutput.fUniformHandles.fDstCopyTopLeftUni,
|
| + fProgramResourceManager->set2f(fBuilderOutput.fUniformHandles.fDstCopyTopLeftUni,
|
| static_cast<GrGLfloat>(dstCopy->offset().fX),
|
| static_cast<GrGLfloat>(dstCopy->offset().fY));
|
| - fUniformManager->set2f(fBuilderOutput.fUniformHandles.fDstCopyScaleUni,
|
| + fProgramResourceManager->set2f(fBuilderOutput.fUniformHandles.fDstCopyScaleUni,
|
| 1.f / dstCopy->texture()->width(),
|
| 1.f / dstCopy->texture()->height());
|
| GrGLTexture* texture = static_cast<GrGLTexture*>(dstCopy->texture());
|
| @@ -138,8 +138,8 @@ void GrGLProgram::setData(GrDrawState::BlendOptFlags blendOpts,
|
| SkASSERT(!fBuilderOutput.fUniformHandles.fDstCopySamplerUni.isValid());
|
| }
|
|
|
| - fBuilderOutput.fColorEffects->setData(fGpu, *fUniformManager, colorStages);
|
| - fBuilderOutput.fCoverageEffects->setData(fGpu, *fUniformManager, coverageStages);
|
| + fBuilderOutput.fColorEffects->setData(fGpu, *fProgramResourceManager, colorStages);
|
| + fBuilderOutput.fCoverageEffects->setData(fGpu, *fProgramResourceManager, coverageStages);
|
|
|
|
|
| // PathTexGen state applies to the the fixed function vertex shader. For
|
| @@ -173,7 +173,7 @@ void GrGLProgram::setColor(const GrDrawState& drawState,
|
| // OpenGL ES doesn't support unsigned byte varieties of glUniform
|
| GrGLfloat c[4];
|
| GrColorToRGBAFloat(color, c);
|
| - fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fColorUni, 1, c);
|
| + fProgramResourceManager->set4fv(fBuilderOutput.fUniformHandles.fColorUni, 1, c);
|
| fColor = color;
|
| }
|
| sharedState->fConstAttribColorIndex = -1;
|
| @@ -208,7 +208,7 @@ void GrGLProgram::setCoverage(const GrDrawState& drawState,
|
| // OpenGL ES doesn't support unsigned byte varieties of glUniform
|
| GrGLfloat c[4];
|
| GrColorToRGBAFloat(coverage, c);
|
| - fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fCoverageUni, 1, c);
|
| + fProgramResourceManager->set4fv(fBuilderOutput.fUniformHandles.fCoverageUni, 1, c);
|
| fCoverage = coverage;
|
| }
|
| sharedState->fConstAttribCoverageIndex = -1;
|
| @@ -232,7 +232,7 @@ void GrGLProgram::setMatrixAndRenderTargetHeight(const GrDrawState& drawState) {
|
| // Load the RT height uniform if it is needed to y-flip gl_FragCoord.
|
| if (fBuilderOutput.fUniformHandles.fRTHeightUni.isValid() &&
|
| fMatrixState.fRenderTargetSize.fHeight != size.fHeight) {
|
| - fUniformManager->set1f(fBuilderOutput.fUniformHandles.fRTHeightUni,
|
| + fProgramResourceManager->set1f(fBuilderOutput.fUniformHandles.fRTHeightUni,
|
| SkIntToScalar(size.fHeight));
|
| }
|
|
|
| @@ -251,10 +251,10 @@ void GrGLProgram::setMatrixAndRenderTargetHeight(const GrDrawState& drawState) {
|
|
|
| GrGLfloat viewMatrix[3 * 3];
|
| fMatrixState.getGLMatrix<3>(viewMatrix);
|
| - fUniformManager->setMatrix3f(fBuilderOutput.fUniformHandles.fViewMatrixUni, viewMatrix);
|
| + fProgramResourceManager->setMatrix3f(fBuilderOutput.fUniformHandles.fViewMatrixUni, viewMatrix);
|
|
|
| GrGLfloat rtAdjustmentVec[4];
|
| fMatrixState.getRTAdjustmentVec(rtAdjustmentVec);
|
| - fUniformManager->set4fv(fBuilderOutput.fUniformHandles.fRTAdjustmentUni, 1, rtAdjustmentVec);
|
| + fProgramResourceManager->set4fv(fBuilderOutput.fUniformHandles.fRTAdjustmentUni, 1, rtAdjustmentVec);
|
| }
|
| }
|
|
|