uniquely name FS functions, add lighting effects to unit test

Review URL: http://codereview.appspot.com/6458080/


git-svn-id: http://skia.googlecode.com/svn/trunk@4992 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLShaderBuilder.h b/src/gpu/gl/GrGLShaderBuilder.h
index ab0792b..31d603a 100644
--- a/src/gpu/gl/GrGLShaderBuilder.h
+++ b/src/gpu/gl/GrGLShaderBuilder.h
@@ -66,6 +66,16 @@
                                  const char* samplerName,
                                  const char* coordName);
 
+    /** Emits a helper function outside of main(). Currently ShaderType must be
+        kFragment_ShaderType. */
+    void emitFunction(ShaderType shader,
+                      GrSLType returnType,
+                      const char* name,
+                      int argCnt,
+                      const GrGLShaderVar* args,
+                      const char* body,
+                      SkString* outName);
+
     /** Generates a StageKey for the shader code based on the texture access parameters and the
         capabilities of the GL context.  This is useful for keying the shader programs that may
         have multiple representations, based on the type/format of textures used. */
@@ -144,7 +154,6 @@
     VarArray    fFSInputs;
     SkString    fGSHeader; // layout qualifiers specific to GS
     VarArray    fFSOutputs;
-    SkString    fFSFunctions;
     SkString    fVSCode;
     SkString    fGSCode;
     SkString    fFSCode;
@@ -176,6 +185,7 @@
     const GrGLContextInfo&  fContext;
     GrGLUniformManager&     fUniformManager;
     int                     fCurrentStage;
+    SkString                fFSFunctions;
 };
 
 #endif