When getGLInstance is called on a frag proc, the resulting GrGLFragmentProcessor will be the root of a tree of GrGLFragmentProcessors that mirrors the GrFragmentProcessor's tree. This allows setData() to be called recursively (removing the responsibility from compose shader) and allows gl instances direct access to their children gl instances so they can emit their code.

BUG=skia:4182

Review URL: https://codereview.chromium.org/1287023009
diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp
index 163f9d9..01e978e 100644
--- a/src/effects/SkMorphologyImageFilter.cpp
+++ b/src/effects/SkMorphologyImageFilter.cpp
@@ -224,8 +224,6 @@
 
     const char* name() const override { return "Morphology"; }
 
-    GrGLFragmentProcessor* createGLInstance() const override;
-
 protected:
 
     MorphologyType fType;
@@ -233,6 +231,8 @@
     float fRange[2];
 
 private:
+    GrGLFragmentProcessor* onCreateGLInstance() const override;
+
     void onGetGLProcessorKey(const GrGLSLCaps&, GrProcessorKeyBuilder*) const override;
 
     bool onIsEqual(const GrFragmentProcessor&) const override;
@@ -258,7 +258,8 @@
 
     static inline void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuilder* b);
 
-    void setData(const GrGLProgramDataManager&, const GrProcessor&) override;
+protected:
+    void onSetData(const GrGLProgramDataManager&, const GrProcessor&) override;
 
 private:
     int width() const { return GrMorphologyEffect::WidthFromRadius(fRadius); }
@@ -359,7 +360,7 @@
     b->add32(key);
 }
 
-void GrGLMorphologyEffect::setData(const GrGLProgramDataManager& pdman,
+void GrGLMorphologyEffect::onSetData(const GrGLProgramDataManager& pdman,
                                    const GrProcessor& proc) {
     const GrMorphologyEffect& m = proc.cast<GrMorphologyEffect>();
     GrTexture& texture = *m.texture(0);
@@ -423,7 +424,7 @@
     GrGLMorphologyEffect::GenKey(*this, caps, b);
 }
 
-GrGLFragmentProcessor* GrMorphologyEffect::createGLInstance() const {
+GrGLFragmentProcessor* GrMorphologyEffect::onCreateGLInstance() const {
     return SkNEW_ARGS(GrGLMorphologyEffect, (*this));
 }
 bool GrMorphologyEffect::onIsEqual(const GrFragmentProcessor& sBase) const {