| Index: src/effects/SkDisplacementMapEffect.cpp
|
| diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
|
| index dad0623d2f29308af983427d11560eae8cfcd287..dc408856466125254b9b188a9e304ab3d575161e 100644
|
| --- a/src/effects/SkDisplacementMapEffect.cpp
|
| +++ b/src/effects/SkDisplacementMapEffect.cpp
|
| @@ -213,7 +213,7 @@ public:
|
|
|
| static inline EffectKey GenKey(const GrDrawEffect&, const GrGLCaps&);
|
|
|
| - virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVERRIDE;
|
| + virtual void setData(const GrGLContext&, const GrDrawEffect&) SK_OVERRIDE;
|
|
|
| private:
|
| static const GrEffect::CoordsType kCoordsType = GrEffect::kLocal_CoordsType;
|
| @@ -222,7 +222,7 @@ private:
|
| SkDisplacementMapEffect::ChannelSelectorType fYChannelSelector;
|
| GrGLEffectMatrix fDisplacementEffectMatrix;
|
| GrGLEffectMatrix fColorEffectMatrix;
|
| - GrGLUniformManager::UniformHandle fScaleUni;
|
| + GrGLUniform* fScaleUni;
|
|
|
| typedef GrGLEffect INHERITED;
|
| };
|
| @@ -409,9 +409,9 @@ void GrGLDisplacementMapEffect::emitCode(GrGLShaderBuilder* builder,
|
| const TextureSamplerArray& samplers) {
|
| sk_ignore_unused_variable(inputColor);
|
|
|
| - fScaleUni = builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType,
|
| - kVec2f_GrSLType, "Scale");
|
| - const char* scaleUni = builder->getUniformCStr(fScaleUni);
|
| + GrGLShaderBuilder::Uniform* scaleUni =
|
| + builder->addUniform(GrGLShaderBuilder::kFragment_ShaderType, kVec2f_GrSLType, "Scale");
|
| + fScaleUni = scaleUni->glUniform();
|
|
|
| const char* dCoordsIn;
|
| GrSLType dCoordsType = fDisplacementEffectMatrix.emitCode(
|
| @@ -439,7 +439,7 @@ void GrGLDisplacementMapEffect::emitCode(GrGLShaderBuilder* builder,
|
| dColor, dColor, nearZero, dColor, dColor);
|
|
|
| builder->fsCodeAppendf("\t\tvec2 %s = %s + %s*(%s.",
|
| - cCoords, cCoordsIn, scaleUni, dColor);
|
| + cCoords, cCoordsIn, scaleUni->c_str(), dColor);
|
|
|
| switch (fXChannelSelector) {
|
| case SkDisplacementMapEffect::kR_ChannelSelectorType:
|
| @@ -491,24 +491,24 @@ void GrGLDisplacementMapEffect::emitCode(GrGLShaderBuilder* builder,
|
| builder->fsCodeAppend(";\n");
|
| }
|
|
|
| -void GrGLDisplacementMapEffect::setData(const GrGLUniformManager& uman,
|
| +void GrGLDisplacementMapEffect::setData(const GrGLContext& context,
|
| const GrDrawEffect& drawEffect) {
|
| const GrDisplacementMapEffect& displacementMap =
|
| drawEffect.castEffect<GrDisplacementMapEffect>();
|
| GrTexture* displTex = displacementMap.texture(0);
|
| GrTexture* colorTex = displacementMap.texture(1);
|
| - fDisplacementEffectMatrix.setData(uman,
|
| + fDisplacementEffectMatrix.setData(context,
|
| GrEffect::MakeDivByTextureWHMatrix(displTex),
|
| drawEffect,
|
| displTex);
|
| - fColorEffectMatrix.setData(uman,
|
| + fColorEffectMatrix.setData(context,
|
| GrEffect::MakeDivByTextureWHMatrix(colorTex),
|
| drawEffect,
|
| colorTex);
|
|
|
| SkScalar scaleX = SkScalarDiv(displacementMap.scale(), SkIntToScalar(colorTex->width()));
|
| SkScalar scaleY = SkScalarDiv(displacementMap.scale(), SkIntToScalar(colorTex->height()));
|
| - uman.set2f(fScaleUni, SkScalarToFloat(scaleX),
|
| + fScaleUni->set2f(context, SkScalarToFloat(scaleX),
|
| colorTex->origin() == kTopLeft_GrSurfaceOrigin ?
|
| SkScalarToFloat(scaleY) : SkScalarToFloat(-scaleY));
|
| }
|
|
|