| Index: src/gpu/gl/GrGLProgram.h
|
| diff --git a/src/gpu/gl/GrGLProgram.h b/src/gpu/gl/GrGLProgram.h
|
| index be6e6878dfad918cae6019fb7e39f9b6c042fbe9..ce43b710bfeb3dd13e9458a905a81e7b9b846272 100644
|
| --- a/src/gpu/gl/GrGLProgram.h
|
| +++ b/src/gpu/gl/GrGLProgram.h
|
| @@ -156,8 +156,7 @@ private:
|
| // Helper for setData() that sets the view matrix and loads the render target height uniform
|
| void setMatrixAndRenderTargetHeight(const GrDrawState&);
|
|
|
| - typedef SkSTArray<4, UniformHandle, true> SamplerUniSArray;
|
| -
|
| + // handles for uniforms (aside from per-effect samplers)
|
| struct UniformHandles {
|
| UniformHandle fViewMatrixUni;
|
| UniformHandle fColorUni;
|
| @@ -173,9 +172,6 @@ private:
|
| UniformHandle fDstCopyScaleUni;
|
| UniformHandle fDstCopySamplerUni;
|
|
|
| - // An array of sampler uniform handles for each effect.
|
| - SamplerUniSArray fEffectSamplerUnis[GrDrawState::kNumStages];
|
| -
|
| UniformHandles() {
|
| fViewMatrixUni = GrGLUniformManager::kInvalidUniformHandle;
|
| fColorUni = GrGLUniformManager::kInvalidUniformHandle;
|
| @@ -188,6 +184,17 @@ private:
|
| }
|
| };
|
|
|
| + typedef SkSTArray<4, UniformHandle, true> SamplerUniSArray;
|
| + typedef SkSTArray<4, int, true> TextureUnitSArray;
|
| +
|
| + struct EffectAndSamplers {
|
| + EffectAndSamplers() : fGLEffect(NULL) {}
|
| + ~EffectAndSamplers() { delete fGLEffect; }
|
| + GrGLEffect* fGLEffect;
|
| + SamplerUniSArray fSamplerUnis; // sampler uni handles for effect's GrTextureAccess
|
| + TextureUnitSArray fTextureUnits; // texture unit used for each entry of fSamplerUnis
|
| + };
|
| +
|
| // GL IDs
|
| GrGLuint fVShaderID;
|
| GrGLuint fGShaderID;
|
| @@ -199,8 +206,9 @@ private:
|
| GrColor fColor;
|
| GrColor fCoverage;
|
| GrColor fColorFilterColor;
|
| + int fDstCopyTexUnit;
|
|
|
| - GrGLEffect* fEffects[GrDrawState::kNumStages];
|
| + SkTArray<EffectAndSamplers> fEffectStates;
|
|
|
| GrGLProgramDesc fDesc;
|
| const GrGLContext& fContext;
|
|
|