Add support for GLSL 1.40.
Review URL: https://codereview.appspot.com/6709070

git-svn-id: http://skia.googlecode.com/svn/trunk@6046 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLSL.cpp b/src/gpu/gl/GrGLSL.cpp
index 420af03..64b6c11 100644
--- a/src/gpu/gl/GrGLSL.cpp
+++ b/src/gpu/gl/GrGLSL.cpp
@@ -17,6 +17,8 @@
             GrAssert(ver >= GR_GLSL_VER(1,10));
             if (ver >= GR_GLSL_VER(1,50)) {
                 return k150_GrGLSLGeneration;
+            } else if (ver >= GR_GLSL_VER(1,40)) {
+                return k140_GrGLSLGeneration;
             } else if (ver >= GR_GLSL_VER(1,30)) {
                 return k130_GrGLSLGeneration;
             } else {
@@ -47,6 +49,9 @@
         case k130_GrGLSLGeneration:
             GrAssert(kDesktop_GrGLBinding == binding);
             return "#version 130\n";
+        case k140_GrGLSLGeneration:
+            GrAssert(kDesktop_GrGLBinding == binding);
+            return "#version 140\n";
         case k150_GrGLSLGeneration:
             GrAssert(kDesktop_GrGLBinding == binding);
             return "#version 150\n";
diff --git a/src/gpu/gl/GrGLSL.h b/src/gpu/gl/GrGLSL.h
index cbff273..ec34eea 100644
--- a/src/gpu/gl/GrGLSL.h
+++ b/src/gpu/gl/GrGLSL.h
@@ -17,7 +17,7 @@
 // down the GLSL version to one of these enums.
 enum GrGLSLGeneration {
     /**
-     * Desktop GLSL 1.10 and ES2 shading lang (based on desktop GLSL 1.20)
+     * Desktop GLSL 1.10 and ES2 shading language (based on desktop GLSL 1.20)
      */
     k110_GrGLSLGeneration,
     /**
@@ -25,7 +25,11 @@
      */
     k130_GrGLSLGeneration,
     /**
-     * Dekstop GLSL 1.50
+     * Desktop GLSL 1.40
+     */
+    k140_GrGLSLGeneration,
+    /**
+     * Desktop GLSL 1.50
      */
     k150_GrGLSLGeneration,
 };
@@ -33,7 +37,7 @@
 /**
  * Types of shader-language-specific boxed variables we can create.
  * (Currently only GrGLShaderVars, but should be applicable to other shader
- * langauges.)
+ * languages.)
  */
 enum GrSLType {
     kVoid_GrSLType,
@@ -90,7 +94,7 @@
                                      const GrGLInterface* gl);
 
 /**
- * Returns a string to include at the begining of a shader to declare the GLSL
+ * Returns a string to include at the beginning of a shader to declare the GLSL
  * version.
  */
 const char* GrGetGLSLVersionDecl(GrGLBinding binding,
@@ -136,7 +140,7 @@
   * vec4(0,0,0,0) is assumed. It is an error to pass kNone for default<i> if in<i> is NULL or "".
   * Note that when if function determines that the result is a zeros or ones vec then any expression
   * represented by in0 or in1 will not be emitted. The return value indicates whether a zeros, ones
-  * or neither was appeneded.
+  * or neither was appended.
   */
 GrSLConstantVec GrGLSLModulate4f(SkString* outAppend,
                                  const char* in0,
@@ -146,7 +150,7 @@
 
 /**
  * Does an inplace mul, *=, of vec4VarName by mulFactor. If mulFactorDefault is not kNone then
- * mulFactor may be either "" or NULL. In this case either nothing will be appened (kOnes) or an
+ * mulFactor may be either "" or NULL. In this case either nothing will be appended (kOnes) or an
  * assignment of vec(0,0,0,0) will be appended (kZeros). The assignment is prepended by tabCnt tabs.
  * A semicolon and newline are added after the assignment. (TODO: Remove tabCnt when we auto-insert
  * tabs to custom stage-generated lines.) If a zeros vec is assigned then the return value is