Index: src/effects/SkLightingShader.cpp |
diff --git a/src/effects/SkLightingShader.cpp b/src/effects/SkLightingShader.cpp |
index 6ed98746397cfcfb5d193d6281b9d543cb0a911c..d441d9ba9fd298c6b6a44503e591e0939f47e91c 100644 |
--- a/src/effects/SkLightingShader.cpp |
+++ b/src/effects/SkLightingShader.cpp |
@@ -185,7 +185,15 @@ public: |
fpb->codeAppendf("%s = vec4(result.rgb, diffuseColor.a);", args.fOutputColor); |
} |
- void setData(const GrGLProgramDataManager& pdman, const GrProcessor& proc) override { |
+ static void GenKey(const GrProcessor& proc, const GrGLSLCaps&, |
+ GrProcessorKeyBuilder* b) { |
+// const LightingFP& lightingFP = proc.cast<LightingFP>(); |
+ // only one shader generated currently |
+ b->add32(0x0); |
+ } |
+ |
+ protected: |
+ void onSetData(const GrGLProgramDataManager& pdman, const GrProcessor& proc) override { |
const LightingFP& lightingFP = proc.cast<LightingFP>(); |
const SkVector3& lightDir = lightingFP.lightDir(); |
@@ -207,13 +215,6 @@ public: |
} |
} |
- static void GenKey(const GrProcessor& proc, const GrGLSLCaps&, |
- GrProcessorKeyBuilder* b) { |
-// const LightingFP& lightingFP = proc.cast<LightingFP>(); |
- // only one shader generated currently |
- b->add32(0x0); |
- } |
- |
private: |
SkVector3 fLightDir; |
GrGLProgramDataManager::UniformHandle fLightDirUni; |
@@ -225,8 +226,6 @@ public: |
GrGLProgramDataManager::UniformHandle fAmbientColorUni; |
}; |
- GrGLFragmentProcessor* createGLInstance() const override { return SkNEW(LightingGLFP); } |
- |
void onGetGLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) const override { |
LightingGLFP::GenKey(*this, caps, b); |
} |
@@ -242,6 +241,8 @@ public: |
const SkColor3f& ambientColor() const { return fAmbientColor; } |
private: |
+ GrGLFragmentProcessor* onCreateGLInstance() const override { return SkNEW(LightingGLFP); } |
+ |
bool onIsEqual(const GrFragmentProcessor& proc) const override { |
const LightingFP& lightingFP = proc.cast<LightingFP>(); |
return fDeviceTransform == lightingFP.fDeviceTransform && |