Resubmit 2289 with fix for glsl version



git-svn-id: http://skia.googlecode.com/svn/trunk@2291 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/src/GrGLProgram.h b/gpu/src/GrGLProgram.h
index 90e515f..6b07f30 100644
--- a/gpu/src/GrGLProgram.h
+++ b/gpu/src/GrGLProgram.h
@@ -18,17 +18,7 @@
 
 class GrBinHashKeyBuilder;
 
-struct ShaderCodeSegments {
-    GrStringBuilder fHeader; // VS+FS, GLSL version, etc
-    GrStringBuilder fVSUnis;
-    GrStringBuilder fVSAttrs;
-    GrStringBuilder fVaryings;
-    GrStringBuilder fFSUnis;
-    GrStringBuilder fFSOutputs;
-    GrStringBuilder fFSFunctions;
-    GrStringBuilder fVSCode;
-    GrStringBuilder fFSCode;
-};
+struct ShaderCodeSegments;
 
 /**
  * This class manages a GPU program and records per-program information.
@@ -41,6 +31,11 @@
  */
 class GrGLProgram {
 public:
+    enum GLSLVersion {
+        k120_GLSLVersion, // Desktop GLSL 1.2 and ES2 shading lang
+        k130_GLSLVersion  // Desktop GLSL 1.3
+    };
+
     class CachedData;
 
     GrGLProgram();
@@ -52,6 +47,7 @@
      *  but in a separate cacheable container.
      */
     bool genProgram(const GrGLInterface* gl,
+                    GLSLVersion glslVersion,
                     CachedData* programData) const;
 
      /**
@@ -286,7 +282,7 @@
                       const char* vsInCoord,
                       ShaderCodeSegments* segments,
                       StageUniLocations* locations) const;
-    
+
     // generates code to compute coverage based on edge AA.
     void genEdgeCoverage(const GrGLInterface* gl,
                          GrVertexLayout layout,
@@ -295,6 +291,7 @@
                          ShaderCodeSegments* segments) const;
 
     static bool CompileFSAndVS(const GrGLInterface* gl,
+                               GLSLVersion glslVersion,
                                const ShaderCodeSegments& segments, 
                                CachedData* programData);