From eb715c8d5caa2191d611c4f9cfb22b4afc6c8d02 Mon Sep 17 00:00:00 2001 From: "bsalomon@google.com" Date: Wed, 11 Jul 2012 15:03:31 +0000 Subject: VariableVisibility -> ShaderType Review URL: http://codereview.appspot.com/6344103/ git-svn-id: http://skia.googlecode.com/svn/trunk@4534 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/effects/GrConvolutionEffect.cpp | 11 +++++------ src/gpu/effects/GrGradientEffects.cpp | 20 ++++++++------------ src/gpu/effects/GrMorphologyEffect.cpp | 6 +++--- 3 files changed, 16 insertions(+), 21 deletions(-) (limited to 'src/gpu/effects') diff --git a/src/gpu/effects/GrConvolutionEffect.cpp b/src/gpu/effects/GrConvolutionEffect.cpp index 349c8672b3..42dc2b49f1 100644 --- a/src/gpu/effects/GrConvolutionEffect.cpp +++ b/src/gpu/effects/GrConvolutionEffect.cpp @@ -60,12 +60,11 @@ GrGLConvolutionEffect::GrGLConvolutionEffect(const GrProgramStageFactory& factor void GrGLConvolutionEffect::setupVariables(GrGLShaderBuilder* state, int stage) { - fImageIncrementVar = &state->addUniform( - GrGLShaderBuilder::kBoth_VariableLifetime, - kVec2f_GrSLType, "uImageIncrement", stage); - fKernelVar = &state->addUniform( - GrGLShaderBuilder::kFragment_VariableLifetime, - kFloat_GrSLType, "uKernel", stage, this->width()); + fImageIncrementVar = &state->addUniform(GrGLShaderBuilder::kFragment_ShaderType | + GrGLShaderBuilder::kVertex_ShaderType, + kVec2f_GrSLType, "uImageIncrement", stage); + fKernelVar = &state->addUniform(GrGLShaderBuilder::kFragment_ShaderType, + kFloat_GrSLType, "uKernel", stage, this->width()); fImageIncrementLocation = kUseUniform; fKernelLocation = kUseUniform; diff --git a/src/gpu/effects/GrGradientEffects.cpp b/src/gpu/effects/GrGradientEffects.cpp index 9d7596574b..604595692d 100644 --- a/src/gpu/effects/GrGradientEffects.cpp +++ b/src/gpu/effects/GrGradientEffects.cpp @@ -142,12 +142,10 @@ void GrGLRadial2Gradient::setupVariables(GrGLShaderBuilder* state, int stage) { // 2 copies of uniform array, 1 for each of vertex & fragment shader, // to work around Xoom bug. Doesn't seem to cause performance decrease // in test apps, but need to keep an eye on it. - fVSParamVar = &state->addUniform( - GrGLShaderBuilder::kVertex_VariableLifetime, - kFloat_GrSLType, "uRadial2VSParams", stage, 6); - fFSParamVar = &state->addUniform( - GrGLShaderBuilder::kFragment_VariableLifetime, - kFloat_GrSLType, "uRadial2FSParams", stage, 6); + fVSParamVar = &state->addUniform(GrGLShaderBuilder::kVertex_ShaderType, + kFloat_GrSLType, "uRadial2VSParams", stage, 6); + fFSParamVar = &state->addUniform(GrGLShaderBuilder::kFragment_ShaderType, + kFloat_GrSLType, "uRadial2FSParams", stage, 6); fVSParamLocation = GrGLProgramStage::kUseUniform; fFSParamLocation = GrGLProgramStage::kUseUniform; @@ -399,12 +397,10 @@ void GrGLConical2Gradient::setupVariables(GrGLShaderBuilder* state, int stage) { // 2 copies of uniform array, 1 for each of vertex & fragment shader, // to work around Xoom bug. Doesn't seem to cause performance decrease // in test apps, but need to keep an eye on it. - fVSParamVar = &state->addUniform( - GrGLShaderBuilder::kVertex_VariableLifetime, - kFloat_GrSLType, "uConical2VSParams", stage, 6); - fFSParamVar = &state->addUniform( - GrGLShaderBuilder::kFragment_VariableLifetime, - kFloat_GrSLType, "uConical2FSParams", stage, 6); + fVSParamVar = &state->addUniform(GrGLShaderBuilder::kVertex_ShaderType, + kFloat_GrSLType, "uConical2VSParams", stage, 6); + fFSParamVar = &state->addUniform(GrGLShaderBuilder::kFragment_ShaderType, + kFloat_GrSLType, "uConical2FSParams", stage, 6); fVSParamLocation = GrGLProgramStage::kUseUniform; fFSParamLocation = GrGLProgramStage::kUseUniform; diff --git a/src/gpu/effects/GrMorphologyEffect.cpp b/src/gpu/effects/GrMorphologyEffect.cpp index 40c1300bfe..43e870285f 100644 --- a/src/gpu/effects/GrMorphologyEffect.cpp +++ b/src/gpu/effects/GrMorphologyEffect.cpp @@ -57,9 +57,9 @@ GrGLMorphologyEffect ::GrGLMorphologyEffect(const GrProgramStageFactory& factory } void GrGLMorphologyEffect::setupVariables(GrGLShaderBuilder* state, int stage) { - fImageIncrementVar = &state->addUniform( - GrGLShaderBuilder::kBoth_VariableLifetime, - kVec2f_GrSLType, "uImageIncrement", stage); + fImageIncrementVar = &state->addUniform(GrGLShaderBuilder::kFragment_ShaderType | + GrGLShaderBuilder::kVertex_ShaderType, + kVec2f_GrSLType, "uImageIncrement", stage); } void GrGLMorphologyEffect::emitVS(GrGLShaderBuilder* state, -- cgit v1.2.3