Re-land of "eliminated GrGLSLExpr".


This change is exactly the same as the last time it was landed; I believe the
underlying optimizer bug that was causing this to cause problems has been
fixed by a prior CL.
Bug: skia:
Change-Id: I5436422f094ea758caa3cd69e9338db31b1f93fa
Reviewed-on: https://skia-review.googlesource.com/15768
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 3be6c1b..9ecc84e 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1583,8 +1583,7 @@
             if (ge.fColorSpaceXform) {
                 fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
             }
-            fragBuilder->codeAppendf("%s = %s;", outputColor,
-                                     (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+            fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
 
             break;
         }
@@ -1622,8 +1621,7 @@
             if (ge.fColorSpaceXform) {
                 fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
             }
-            fragBuilder->codeAppendf("%s = %s;", outputColor,
-                                     (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+            fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
 
             break;
         }
@@ -1661,8 +1659,7 @@
             if (ge.fColorSpaceXform) {
                 fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
             }
-            fragBuilder->codeAppendf("%s = %s;", outputColor,
-                                     (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+            fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
 
             break;
         }
@@ -1688,8 +1685,7 @@
                 fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
             }
 
-            fragBuilder->codeAppendf("%s = %s;", outputColor,
-                                     (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+            fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
 
             break;
         }
@@ -1720,8 +1716,7 @@
                 fragBuilder->codeAppend("colorTemp.rgb = clamp(colorTemp.rgb, 0, colorTemp.a);");
             }
 
-            fragBuilder->codeAppendf("%s = %s;", outputColor,
-                                     (GrGLSLExpr4(inputColor) * GrGLSLExpr4("colorTemp")).c_str());
+            fragBuilder->codeAppendf("%s = %s * colorTemp;", outputColor, inputColor);
 
             break;
         }