renamed SkSL types in preparation for killing precision modifiers

Bug: skia:
Change-Id: Iff0289e25355a89cdc289a0892ed755dd1b1c900
Reviewed-on: https://skia-review.googlesource.com/27703
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/glsl/GrGLSLBlend.cpp b/src/gpu/glsl/GrGLSLBlend.cpp
index bee5a83..b37169b 100644
--- a/src/gpu/glsl/GrGLSLBlend.cpp
+++ b/src/gpu/glsl/GrGLSLBlend.cpp
@@ -120,14 +120,14 @@
 // Adds a function that takes two colors and an alpha as input. It produces a color with the
 // hue and saturation of the first color, the luminosity of the second color, and the input
 // alpha. It has this signature:
-//      vec3 set_luminance(vec3 hueSatColor, float alpha, vec3 lumColor).
+//      float3 set_luminance(float3 hueSatColor, float alpha, float3 lumColor).
 static void add_lum_function(GrGLSLFragmentBuilder* fsBuilder, SkString* setLumFunction) {
     // Emit a helper that gets the luminance of a color.
     SkString getFunction;
     GrShaderVar getLumArgs[] = {
         GrShaderVar("color", kVec3f_GrSLType),
     };
-    SkString getLumBody("return dot(vec3(0.3, 0.59, 0.11), color);");
+    SkString getLumBody("return dot(float3(0.3, 0.59, 0.11), color);");
     fsBuilder->emitFunction(kFloat_GrSLType,
                             "luminance",
                             SK_ARRAY_COUNT(getLumArgs), getLumArgs,
@@ -142,17 +142,17 @@
     };
     SkString setLumBody;
     setLumBody.printf("float diff = %s(lumColor - hueSat);", getFunction.c_str());
-    setLumBody.append("vec3 outColor = hueSat + diff;");
+    setLumBody.append("float3 outColor = hueSat + diff;");
     setLumBody.appendf("float outLum = %s(outColor);", getFunction.c_str());
     setLumBody.append("float minComp = min(min(outColor.r, outColor.g), outColor.b);"
                       "float maxComp = max(max(outColor.r, outColor.g), outColor.b);"
                       "if (minComp < 0.0 && outLum != minComp) {"
-                      "outColor = outLum + ((outColor - vec3(outLum, outLum, outLum)) * outLum) /"
+                      "outColor = outLum + ((outColor - float3(outLum, outLum, outLum)) * outLum) /"
                       "(outLum - minComp);"
                       "}"
                       "if (maxComp > alpha && maxComp != outLum) {"
                       "outColor = outLum +"
-                      "((outColor - vec3(outLum, outLum, outLum)) * (alpha - outLum)) /"
+                      "((outColor - float3(outLum, outLum, outLum)) * (alpha - outLum)) /"
                       "(maxComp - outLum);"
                       "}"
                       "return outColor;");
@@ -165,7 +165,7 @@
 
 // Adds a function that creates a color with the hue and luminosity of one input color and
 // the saturation of another color. It will have this signature:
-//      float set_saturation(vec3 hueLumColor, vec3 satColor)
+//      float set_saturation(float3 hueLumColor, float3 satColor)
 static void add_sat_function(GrGLSLFragmentBuilder* fsBuilder, SkString* setSatFunction) {
     // Emit a helper that gets the saturation of a color
     SkString getFunction;
@@ -181,7 +181,7 @@
 
     // Emit a helper that sets the saturation given sorted input channels. This used
     // to use inout params for min, mid, and max components but that seems to cause
-    // problems on PowerVR drivers. So instead it returns a vec3 where r, g ,b are the
+    // problems on PowerVR drivers. So instead it returns a float3 where r, g ,b are the
     // adjusted min, mid, and max inputs, respectively.
     SkString helperFunction;
     GrShaderVar helperArgs[] = {
@@ -191,13 +191,13 @@
         GrShaderVar("sat", kFloat_GrSLType),
     };
     static const char kHelperBody[] = "if (minComp < maxComp) {"
-        "vec3 result;"
+        "float3 result;"
         "result.r = 0.0;"
         "result.g = sat * (midComp - minComp) / (maxComp - minComp);"
         "result.b = sat;"
         "return result;"
         "} else {"
-        "return vec3(0, 0, 0);"
+        "return float3(0, 0, 0);"
         "}";
     fsBuilder->emitFunction(kVec3f_GrSLType,
                             "set_saturation_helper",
@@ -311,7 +311,7 @@
             SkString setSat, setLum;
             add_sat_function(fsBuilder, &setSat);
             add_lum_function(fsBuilder, &setLum);
-            fsBuilder->codeAppendf("vec4 dstSrcAlpha = %s * %s.a;",
+            fsBuilder->codeAppendf("float4 dstSrcAlpha = %s * %s.a;",
                                    dstColor, srcColor);
             fsBuilder->codeAppendf("%s.rgb = %s(%s(%s.rgb * %s.a, dstSrcAlpha.rgb),"
                                    "dstSrcAlpha.a, dstSrcAlpha.rgb);",
@@ -326,7 +326,7 @@
             SkString setSat, setLum;
             add_sat_function(fsBuilder, &setSat);
             add_lum_function(fsBuilder, &setLum);
-            fsBuilder->codeAppendf("vec4 dstSrcAlpha = %s * %s.a;",
+            fsBuilder->codeAppendf("float4 dstSrcAlpha = %s * %s.a;",
                                    dstColor, srcColor);
             fsBuilder->codeAppendf("%s.rgb = %s(%s(dstSrcAlpha.rgb, %s.rgb * %s.a),"
                                    "dstSrcAlpha.a, dstSrcAlpha.rgb);",
@@ -340,7 +340,7 @@
             //  SetLum(S * Da, Sa* Da, D * Sa) + (1 - Sa) * D + (1 - Da) * S
             SkString setLum;
             add_lum_function(fsBuilder, &setLum);
-            fsBuilder->codeAppendf("vec4 srcDstAlpha = %s * %s.a;",
+            fsBuilder->codeAppendf("float4 srcDstAlpha = %s * %s.a;",
                                    srcColor, dstColor);
             fsBuilder->codeAppendf("%s.rgb = %s(srcDstAlpha.rgb, srcDstAlpha.a, %s.rgb * %s.a);",
                                    outputColor, setLum.c_str(), dstColor, srcColor);
@@ -352,7 +352,7 @@
             //  SetLum(D * Sa, Sa* Da, S * Da) + (1 - Sa) * D + (1 - Da) * S
             SkString setLum;
             add_lum_function(fsBuilder, &setLum);
-            fsBuilder->codeAppendf("vec4 srcDstAlpha = %s * %s.a;",
+            fsBuilder->codeAppendf("float4 srcDstAlpha = %s * %s.a;",
                                    srcColor, dstColor);
             fsBuilder->codeAppendf("%s.rgb = %s(%s.rgb * %s.a, srcDstAlpha.a, srcDstAlpha.rgb);",
                                    outputColor, setLum.c_str(), dstColor, srcColor);
@@ -387,13 +387,13 @@
                 fsBuilder->codeAppendf(" * %s", srcColorName);
                 break;
             case SkBlendModeCoeff::kISC:
-                fsBuilder->codeAppendf(" * (vec4(1.0) - %s)", srcColorName);
+                fsBuilder->codeAppendf(" * (float4(1.0) - %s)", srcColorName);
                 break;
             case SkBlendModeCoeff::kDC:
                 fsBuilder->codeAppendf(" * %s", dstColorName);
                 break;
             case SkBlendModeCoeff::kIDC:
-                fsBuilder->codeAppendf(" * (vec4(1.0) - %s)", dstColorName);
+                fsBuilder->codeAppendf(" * (float4(1.0) - %s)", dstColorName);
                 break;
             case SkBlendModeCoeff::kSA:
                 fsBuilder->codeAppendf(" * %s.a", srcColorName);
@@ -434,7 +434,7 @@
                                                 false);
         // append dst blend
         if(!append_porterduff_term(fsBuilder, dstCoeff, dstColor, srcColor, dstColor, didAppend)) {
-            fsBuilder->codeAppend("vec4(0, 0, 0, 0)");
+            fsBuilder->codeAppend("float4(0, 0, 0, 0)");
         }
         if (clamp) {
             fsBuilder->codeAppend(", 0, 1);");
@@ -486,7 +486,7 @@
                                             false);
     // append dst blend
     if(!append_porterduff_term(fsBuilder, dstCoeff, dstColor, srcColor, dstColor, didAppend)) {
-        fsBuilder->codeAppend("vec4(0, 0, 0, 0)");
+        fsBuilder->codeAppend("float4(0, 0, 0, 0)");
     }
     fsBuilder->codeAppend(";");
 }
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
index 006fe58..6f75c16 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.cpp
@@ -29,7 +29,7 @@
     SkASSERT(outputColor);
     GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
     outputColor->append(fragBuilder->getMangleString());
-    fragBuilder->codeAppendf("vec4 %s;", outputColor->c_str());
+    fragBuilder->codeAppendf("float4 %s;", outputColor->c_str());
     this->internalEmitChild(childIndex, inputColor, outputColor->c_str(), args);
 }
 
diff --git a/src/gpu/glsl/GrGLSLFragmentProcessor.h b/src/gpu/glsl/GrGLSLFragmentProcessor.h
index 355d490..ed4b71f 100644
--- a/src/gpu/glsl/GrGLSLFragmentProcessor.h
+++ b/src/gpu/glsl/GrGLSLFragmentProcessor.h
@@ -86,9 +86,9 @@
         @param fp                The processor that generated this program stage.
         @param key               The key that was computed by GenKey() from the generating
                                  GrProcessor.
-        @param outputColor       A predefined vec4 in the FS in which the stage should place its
+        @param outputColor       A predefined float4 in the FS in which the stage should place its
                                  output color (or coverage).
-        @param inputColor        A vec4 that holds the input color to the stage in the FS. This may
+        @param inputColor        A float4 that holds the input color to the stage in the FS. This may
                                  be nullptr in which case the implied input is solid white (all
                                  ones). TODO: Better system for communicating optimization info
                                  (e.g. input color is solid white, trans black, known to be opaque,
@@ -152,7 +152,7 @@
     }
 
     inline void emitChild(int childIndex, SkString* outputColor, EmitArgs& parentArgs) {
-        this->emitChild(childIndex, "vec4(1.0)", outputColor, parentArgs);
+        this->emitChild(childIndex, "float4(1.0)", outputColor, parentArgs);
     }
 
     /** Will emit the code of a child proc in its own scope. Pass in the parent's EmitArgs and
@@ -167,7 +167,7 @@
                    EmitArgs& parentArgs);
 
     inline void emitChild(int childIndex, EmitArgs& args) {
-        this->emitChild(childIndex, "vec4(1.0)", args);
+        this->emitChild(childIndex, "float4(1.0)", args);
     }
 
     /** Variation that uses the parent's output color variable to hold the child's output.*/
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
index 6c0528e..7f16136 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
@@ -119,7 +119,7 @@
 
     SkString coords2D;
     coords2D.printf("%s_ensure2D", coords.c_str());
-    this->codeAppendf("\tvec2 %s = %s.xy / %s.z;", coords2D.c_str(), coords.c_str(),
+    this->codeAppendf("\tfloat2 %s = %s.xy / %s.z;", coords2D.c_str(), coords.c_str(),
                       coords.c_str());
     return coords2D;
 }
@@ -199,7 +199,7 @@
             fOutputs[fCustomColorOutputIndex].setTypeModifier(GrShaderVar::kInOut_TypeModifier);
             fbFetchColorName = DeclaredColorOutputName();
             // Set the dstColor to an intermediate variable so we don't override it with the output
-            this->codeAppendf("vec4 %s = %s;", kDstColorName, fbFetchColorName);
+            this->codeAppendf("float4 %s = %s;", kDstColorName, fbFetchColorName);
         } else {
             return fbFetchColorName;
         }
@@ -305,9 +305,9 @@
     SkSTArray<16, SkPoint, true> offsets;
     offsets.push_back_n(specs.fEffectiveSampleCnt);
     m.mapPoints(offsets.begin(), specs.fSampleLocations, specs.fEffectiveSampleCnt);
-    this->definitions().appendf("const highp vec2 %s[] = vec2[](", name);
+    this->definitions().appendf("const highp float2 %s[] = float2[](", name);
     for (int i = 0; i < specs.fEffectiveSampleCnt; ++i) {
-        this->definitions().appendf("vec2(%f, %f)", offsets[i].x(), offsets[i].y());
+        this->definitions().appendf("float2(%f, %f)", offsets[i].x(), offsets[i].y());
         this->definitions().append(i + 1 != specs.fEffectiveSampleCnt ? ", " : ");\n");
     }
 }
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
index 9dd1cba..3ab5b68 100644
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.cpp
@@ -62,9 +62,9 @@
         handler->specifyCoordsForCurrCoordTransform(SkString(v.fsIn()), varyingType);
 
         if (kVec2f_GrSLType == varyingType) {
-            vb->codeAppendf("%s = (%s * vec3(%s, 1)).xy;", v.vsOut(), uniName, localCoords);
+            vb->codeAppendf("%s = (%s * float3(%s, 1)).xy;", v.vsOut(), uniName, localCoords);
         } else {
-            vb->codeAppendf("%s = %s * vec3(%s, 1);", v.vsOut(), uniName, localCoords);
+            vb->codeAppendf("%s = %s * float3(%s, 1);", v.vsOut(), uniName, localCoords);
         }
         ++i;
     }
@@ -89,7 +89,7 @@
                                             GrGPArgs* gpArgs,
                                             const char* posName) {
     gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
-    vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
+    vertBuilder->codeAppendf("float2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
 }
 
 void GrGLSLGeometryProcessor::setupPosition(GrGLSLVertexBuilder* vertBuilder,
@@ -100,7 +100,7 @@
                                             UniformHandle* viewMatrixUniform) {
     if (mat.isIdentity()) {
         gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
-        vertBuilder->codeAppendf("vec2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
+        vertBuilder->codeAppendf("float2 %s = %s;", gpArgs->fPositionVar.c_str(), posName);
     } else {
         const char* viewMatrixName;
         *viewMatrixUniform = uniformHandler->addUniform(kVertex_GrShaderFlag,
@@ -109,11 +109,11 @@
                                                         &viewMatrixName);
         if (!mat.hasPerspective()) {
             gpArgs->fPositionVar.set(kVec2f_GrSLType, "pos2");
-            vertBuilder->codeAppendf("vec2 %s = (%s * vec3(%s, 1)).xy;",
+            vertBuilder->codeAppendf("float2 %s = (%s * float3(%s, 1)).xy;",
                                      gpArgs->fPositionVar.c_str(), viewMatrixName, posName);
         } else {
             gpArgs->fPositionVar.set(kVec3f_GrSLType, "pos3");
-            vertBuilder->codeAppendf("vec3 %s = %s * vec3(%s, 1);",
+            vertBuilder->codeAppendf("float3 %s = %s * float3(%s, 1);",
                                      gpArgs->fPositionVar.c_str(), viewMatrixName, posName);
         }
     }
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.h b/src/gpu/glsl/GrGLSLGeometryProcessor.h
index 6777620..10a4aa8 100644
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.h
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.h
@@ -50,7 +50,7 @@
 
     struct GrGPArgs {
         // The variable used by a GP to store its position. It can be
-        // either a vec2 or a vec3 depending on the presence of perspective.
+        // either a float2 or a float3 depending on the presence of perspective.
         GrShaderVar fPositionVar;
     };
 
diff --git a/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
index c2e0ab7..d9d17e5 100644
--- a/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLPrimitiveProcessor.cpp
@@ -49,7 +49,7 @@
                                                &stagedLocalVarName);
     fragBuilder->codeAppendf("%s = %s;", outputName, stagedLocalVarName);
     if (fragBuilder->getProgramBuilder()->shaderCaps()->mustObfuscateUniformColor()) {
-        fragBuilder->codeAppendf("%s = max(%s, vec4(0, 0, 0, 0));", outputName, outputName);
+        fragBuilder->codeAppendf("%s = max(%s, float4(0, 0, 0, 0));", outputName, outputName);
     }
 }
 
diff --git a/src/gpu/glsl/GrGLSLProgramBuilder.cpp b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
index 5c78c07..a3c20c3 100644
--- a/src/gpu/glsl/GrGLSLProgramBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLProgramBuilder.cpp
@@ -239,8 +239,8 @@
                                        this->uniformHandler(),
                                        this->shaderCaps(),
                                        xp,
-                                       colorIn.size() ? colorIn.c_str() : "vec4(1)",
-                                       coverageIn.size() ? coverageIn.c_str() : "vec4(1)",
+                                       colorIn.size() ? colorIn.c_str() : "float4(1)",
+                                       coverageIn.size() ? coverageIn.c_str() : "float4(1)",
                                        fFS.getPrimaryColorOutputName(),
                                        fFS.getSecondaryColorOutputName(),
                                        dstTextureSamplerHandle,
@@ -455,7 +455,7 @@
     } else {
         this->nameVariable(&outName, '\0', baseName);
     }
-    fFS.codeAppendf("vec4 %s;", outName.c_str());
+    fFS.codeAppendf("float4 %s;", outName.c_str());
     *output = outName;
 }
 
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.cpp b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
index 542cee6..8f7d23d 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.cpp
@@ -128,7 +128,7 @@
     SkString functionBody;
     // Gamut xform, clamp to destination gamut. We only support/have premultiplied textures, so we
     // always just clamp to alpha.
-    functionBody.append("\tcolor.rgb = clamp((xform * vec4(color.rgb, 1.0)).rgb, 0.0, color.a);\n");
+    functionBody.append("\tcolor.rgb = clamp((xform * float4(color.rgb, 1.0)).rgb, 0.0, color.a);\n");
     functionBody.append("\treturn color;");
     SkString colorGamutXformFuncName;
     this->emitFunction(kVec4f_GrSLType,
diff --git a/src/gpu/glsl/GrGLSLShaderBuilder.h b/src/gpu/glsl/GrGLSLShaderBuilder.h
index 16e5b86..4906c03 100644
--- a/src/gpu/glsl/GrGLSLShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLShaderBuilder.h
@@ -47,8 +47,8 @@
 
 
     /** Does the work of appendTextureLookup and modulates the result by modulation. The result is
-        always a vec4. modulation and the swizzle specified by SamplerHandle must both be
-        vec4 or float. If modulation is "" or nullptr it this function acts as though
+        always a float4. modulation and the swizzle specified by SamplerHandle must both be
+        float4 or float. If modulation is "" or nullptr it this function acts as though
         appendTextureLookup were called. */
     void appendTextureLookupAndModulate(const char* modulation,
                                         SamplerHandle,
diff --git a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
index 627b11d..e06ee2d 100644
--- a/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
+++ b/src/gpu/glsl/GrGLSLVertexShaderBuilder.cpp
@@ -20,23 +20,23 @@
     if (this->getProgramBuilder()->desc()->header().fSnapVerticesToPixelCenters) {
         if (kVec3f_GrSLType == posVar.getType()) {
             const char* p = posVar.c_str();
-            this->codeAppendf("{vec2 _posTmp = vec2(%s.x/%s.z, %s.y/%s.z);", p, p, p, p);
+            this->codeAppendf("{float2 _posTmp = float2(%s.x/%s.z, %s.y/%s.z);", p, p, p, p);
         } else {
             SkASSERT(kVec2f_GrSLType == posVar.getType());
-            this->codeAppendf("{vec2 _posTmp = %s;", posVar.c_str());
+            this->codeAppendf("{float2 _posTmp = %s;", posVar.c_str());
         }
-        this->codeAppendf("_posTmp = floor(_posTmp) + vec2(0.5, 0.5);"
-                          "gl_Position = vec4(_posTmp.x * %s.x + %s.y,"
-                                             "_posTmp.y * %s.z + %s.w, 0, 1);}",
+        this->codeAppendf("_posTmp = floor(_posTmp) + float2(0.5, 0.5);"
+                          "gl_Position = float4(_posTmp.x * %s.x + %s.y,"
+                                               "_posTmp.y * %s.z + %s.w, 0, 1);}",
                           rtAdjustName, rtAdjustName, rtAdjustName, rtAdjustName);
     } else if (kVec3f_GrSLType == posVar.getType()) {
-        this->codeAppendf("gl_Position = vec4(dot(%s.xz, %s.xy), dot(%s.yz, %s.zw), 0, %s.z);",
+        this->codeAppendf("gl_Position = float4(dot(%s.xz, %s.xy), dot(%s.yz, %s.zw), 0, %s.z);",
                           posVar.c_str(), rtAdjustName,
                           posVar.c_str(), rtAdjustName,
                           posVar.c_str());
     } else {
         SkASSERT(kVec2f_GrSLType == posVar.getType());
-        this->codeAppendf("gl_Position = vec4(%s.x * %s.x + %s.y, %s.y * %s.z + %s.w, 0, 1);",
+        this->codeAppendf("gl_Position = float4(%s.x * %s.x + %s.y, %s.y * %s.z + %s.w, 0, 1);",
                           posVar.c_str(), rtAdjustName, rtAdjustName,
                           posVar.c_str(), rtAdjustName, rtAdjustName);
     }
diff --git a/src/gpu/glsl/GrGLSLXferProcessor.cpp b/src/gpu/glsl/GrGLSLXferProcessor.cpp
index 5af0f05..6c2c460 100644
--- a/src/gpu/glsl/GrGLSLXferProcessor.cpp
+++ b/src/gpu/glsl/GrGLSLXferProcessor.cpp
@@ -52,7 +52,7 @@
             // The discard here also helps for batching text draws together which need to read from
             // a dst copy for blends. Though this only helps the case where the outer bounding boxes
             // of each letter overlap and not two actually parts of the text.
-            fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, vec3(0)))) {"
+            fragBuilder->codeAppendf("if (all(lessThanEqual(%s.rgb, float3(0)))) {"
                                      "    discard;"
                                      "}", args.fInputCoverage);
         }
@@ -72,14 +72,14 @@
                                                   &dstCoordScaleName);
 
         fragBuilder->codeAppend("// Read color from copy of the destination.\n");
-        fragBuilder->codeAppendf("vec2 _dstTexCoord = (sk_FragCoord.xy - %s) * %s;",
+        fragBuilder->codeAppendf("float2 _dstTexCoord = (sk_FragCoord.xy - %s) * %s;",
                                  dstTopLeftName, dstCoordScaleName);
 
         if (flipY) {
             fragBuilder->codeAppend("_dstTexCoord.y = 1.0 - _dstTexCoord.y;");
         }
 
-        fragBuilder->codeAppendf("vec4 %s = ", dstColor);
+        fragBuilder->codeAppendf("float4 %s = ", dstColor);
         fragBuilder->appendTextureLookup(args.fDstTextureSamplerHandle, "_dstTexCoord",
                                          kVec2f_GrSLType);
         fragBuilder->codeAppend(";");
@@ -91,7 +91,7 @@
     if (!needsLocalOutColor) {
         outColor = args.fOutputPrimary;
     } else {
-        fragBuilder->codeAppendf("vec4 %s;", outColor);
+        fragBuilder->codeAppendf("float4 %s;", outColor);
     }
 
     this->emitBlendCodeForDstRead(fragBuilder,
@@ -139,7 +139,7 @@
             fragBuilder->codeAppendf("%s *= %s;", outColor, srcCoverage);
             fragBuilder->codeAppendf("%s = %s;", outColorSecondary, srcCoverage);
         } else {
-            fragBuilder->codeAppendf("%s = vec4(1.0);", outColorSecondary);
+            fragBuilder->codeAppendf("%s = float4(1.0);", outColorSecondary);
         }
     } else if (srcCoverage) {
         if (proc.isLCD()) {
@@ -150,7 +150,7 @@
             fragBuilder->codeAppendf("float lerpGreen = mix(%s.a, %s.a, %s.b);",
                                      dstColor, outColor, srcCoverage);
         }
-        fragBuilder->codeAppendf("%s = %s * %s + (vec4(1.0) - %s) * %s;",
+        fragBuilder->codeAppendf("%s = %s * %s + (float4(1.0) - %s) * %s;",
                                  outColor, srcCoverage, outColor, srcCoverage, dstColor);
         if (proc.isLCD()) {
             fragBuilder->codeAppendf("%s.a = max(max(lerpRed, lerpBlue), lerpGreen);", outColor);