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/ccpr/GrCCPRCoverageProcessor.cpp b/src/gpu/ccpr/GrCCPRCoverageProcessor.cpp
index 85b989b..332a64c 100644
--- a/src/gpu/ccpr/GrCCPRCoverageProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPRCoverageProcessor.cpp
@@ -122,7 +122,8 @@
                                           const TexelBufferHandle& pointsBuffer,
                                           const char* rtAdjust, GrGPArgs* gpArgs) const {
     v->codeAppendf("int packedoffset = %s.w;", proc.instanceAttrib());
-    v->codeAppend ("highp vec2 atlasoffset = vec2((packedoffset<<16) >> 16, packedoffset >> 16);");
+    v->codeAppend ("highp float2 atlasoffset = float2((packedoffset<<16) >> 16, "
+                                                     "packedoffset >> 16);");
 
     this->onEmitVertexShader(proc, v, pointsBuffer, "atlasoffset", rtAdjust, gpArgs);
 }
@@ -150,12 +151,12 @@
             fnBody.appendf("%s = %s * %s;",
                            fFragCoverageTimesWind.gsOut(), coverage, fGeomWind.c_str());
         }
-        fnBody.append ("gl_Position = vec4(position, 0, 1);");
+        fnBody.append ("gl_Position = float4(position, 0, 1);");
         fnBody.append ("EmitVertex();");
         return fnBody;
     }().c_str(), &emitVertexFn);
 
-    g->codeAppendf("highp vec2 bloat = %f * abs(%s.xz);", kAABloatRadius, rtAdjust);
+    g->codeAppendf("highp float2 bloat = %f * abs(%s.xz);", kAABloatRadius, rtAdjust);
 
 #ifdef SK_DEBUG
     if (proc.debugVisualizations()) {
@@ -172,7 +173,7 @@
     SkASSERT(numSides >= 3);
 
     if (!insetPts) {
-        g->codeAppendf("highp vec2 centroidpt = %s * vec%i(%f);",
+        g->codeAppendf("highp float2 centroidpt = %s * float%i(%f);",
                        polygonPts, numSides, 1.0 / numSides);
     }
 
@@ -180,44 +181,44 @@
                        "nextidx = (%s + 1) %% %i;",
                    wedgeIdx, numSides - 1, numSides, wedgeIdx, numSides);
 
-    g->codeAppendf("highp vec2 self = %s[%s];"
+    g->codeAppendf("highp float2 self = %s[%s];"
                    "highp int leftidx = %s > 0 ? previdx : nextidx;"
                    "highp int rightidx = %s > 0 ? nextidx : previdx;",
                    polygonPts, wedgeIdx, fGeomWind.c_str(), fGeomWind.c_str());
 
     // Which quadrant does the vector from self -> right fall into?
-    g->codeAppendf("highp vec2 right = %s[rightidx];", polygonPts);
+    g->codeAppendf("highp float2 right = %s[rightidx];", polygonPts);
     if (3 == numSides) {
         // TODO: evaluate perf gains.
-        g->codeAppend ("highp vec2 qsr = sign(right - self);");
+        g->codeAppend ("highp float2 qsr = sign(right - self);");
     } else {
         SkASSERT(4 == numSides);
-        g->codeAppendf("highp vec2 diag = %s[(%s + 2) %% 4];", polygonPts, wedgeIdx);
-        g->codeAppend ("highp vec2 qsr = sign((right != self ? right : diag) - self);");
+        g->codeAppendf("highp float2 diag = %s[(%s + 2) %% 4];", polygonPts, wedgeIdx);
+        g->codeAppend ("highp float2 qsr = sign((right != self ? right : diag) - self);");
     }
 
     // Which quadrant does the vector from left -> self fall into?
-    g->codeAppendf("highp vec2 qls = sign(self - %s[leftidx]);", polygonPts);
+    g->codeAppendf("highp float2 qls = sign(self - %s[leftidx]);", polygonPts);
 
     // d2 just helps us reduce triangle counts with orthogonal, axis-aligned lines.
     // TODO: evaluate perf gains.
     const char* dr2 = "dr";
     if (3 == numSides) {
         // TODO: evaluate perf gains.
-        g->codeAppend ("highp vec2 dr = vec2(qsr.y != 0 ? +qsr.y : +qsr.x, "
+        g->codeAppend ("highp float2 dr = float2(qsr.y != 0 ? +qsr.y : +qsr.x, "
                                             "qsr.x != 0 ? -qsr.x : +qsr.y);");
-        g->codeAppend ("highp vec2 dr2 = vec2(qsr.y != 0 ? +qsr.y : -qsr.x, "
+        g->codeAppend ("highp float2 dr2 = float2(qsr.y != 0 ? +qsr.y : -qsr.x, "
                                              "qsr.x != 0 ? -qsr.x : -qsr.y);");
-        g->codeAppend ("highp vec2 dl = vec2(qls.y != 0 ? +qls.y : +qls.x, "
+        g->codeAppend ("highp float2 dl = float2(qls.y != 0 ? +qls.y : +qls.x, "
                                             "qls.x != 0 ? -qls.x : +qls.y);");
         dr2 = "dr2";
     } else {
-        g->codeAppend ("highp vec2 dr = vec2(qsr.y != 0 ? +qsr.y : 1, "
+        g->codeAppend ("highp float2 dr = float2(qsr.y != 0 ? +qsr.y : 1, "
                                             "qsr.x != 0 ? -qsr.x : 1);");
-        g->codeAppend ("highp vec2 dl = (qls == vec2(0)) ? dr : vec2(qls.y != 0 ? +qls.y : 1, "
-                                                                    "qls.x != 0 ? -qls.x : 1);");
+        g->codeAppend ("highp float2 dl = (qls == float2(0)) ? dr : "
+                                       "float2(qls.y != 0 ? +qls.y : 1, qls.x != 0 ? -qls.x : 1);");
     }
-    g->codeAppendf("bvec2 dnotequal = notEqual(%s, dl);", dr2);
+    g->codeAppendf("bool2 dnotequal = notEqual(%s, dl);", dr2);
 
     // Emit one third of what is the convex hull of pixel-size boxes centered on the vertices.
     // Each invocation emits a different third.
@@ -235,7 +236,7 @@
     g->codeAppendf(    "%s(self + bloat * dl, 1);", emitVertexFn);
     g->codeAppend ("}");
     g->codeAppend ("if (all(dnotequal)) {");
-    g->codeAppendf(    "%s(self + bloat * vec2(-dl.y, dl.x), 1);", emitVertexFn);
+    g->codeAppendf(    "%s(self + bloat * float2(-dl.y, dl.x), 1);", emitVertexFn);
     g->codeAppend ("}");
     g->codeAppend ("EndPrimitive();");
 
@@ -246,18 +247,18 @@
                                          const char* leftPt, const char* rightPt,
                                          const char* distanceEquation) const {
     if (!distanceEquation) {
-        this->emitEdgeDistanceEquation(g, leftPt, rightPt, "highp vec3 edge_distance_equation");
+        this->emitEdgeDistanceEquation(g, leftPt, rightPt, "highp float3 edge_distance_equation");
         distanceEquation = "edge_distance_equation";
     }
 
     // qlr is defined in emitEdgeDistanceEquation.
-    g->codeAppendf("highp mat2 endpts = mat2(%s - bloat * qlr, %s + bloat * qlr);",
+    g->codeAppendf("highp float2x2 endpts = float2x2(%s - bloat * qlr, %s + bloat * qlr);",
                    leftPt, rightPt);
-    g->codeAppendf("mediump vec2 endpts_coverage = %s.xy * endpts + %s.z;",
+    g->codeAppendf("mediump float2 endpts_coverage = %s.xy * endpts + %s.z;",
                    distanceEquation, distanceEquation);
 
     // d1 is defined in emitEdgeDistanceEquation.
-    g->codeAppend ("highp vec2 d2 = d1;");
+    g->codeAppend ("highp float2 d2 = d1;");
     g->codeAppend ("bool aligned = qlr.x == 0 || qlr.y == 0;");
     g->codeAppend ("if (aligned) {");
     g->codeAppend (    "d1 -= qlr;");
@@ -286,16 +287,17 @@
                                                   const char* leftPt, const char* rightPt,
                                                   const char* outputDistanceEquation) const {
     // Which quadrant does the vector from left -> right fall into?
-    g->codeAppendf("highp vec2 qlr = sign(%s - %s);", rightPt, leftPt);
-    g->codeAppend ("highp vec2 d1 = vec2(qlr.y, -qlr.x);");
+    g->codeAppendf("highp float2 qlr = sign(%s - %s);", rightPt, leftPt);
+    g->codeAppend ("highp float2 d1 = float2(qlr.y, -qlr.x);");
 
-    g->codeAppendf("highp vec2 n = vec2(%s.y - %s.y, %s.x - %s.x);",
+    g->codeAppendf("highp float2 n = float2(%s.y - %s.y, %s.x - %s.x);",
                    rightPt, leftPt, leftPt, rightPt);
-    g->codeAppendf("highp vec2 kk = n * mat2(%s + bloat * d1, %s - bloat * d1);", leftPt, leftPt);
+    g->codeAppendf("highp float2 kk = n * float2x2(%s + bloat * d1, %s - bloat * d1);",
+                   leftPt, leftPt);
     // Clamp for when n=0. wind=0 when n=0 so as long as we don't get Inf or NaN we are fine.
     g->codeAppendf("highp float scale = 1 / max(kk[0] - kk[1], 1e-30);");
 
-    g->codeAppendf("%s = vec3(-n, kk[1]) * scale;", outputDistanceEquation);
+    g->codeAppendf("%s = float3(-n, kk[1]) * scale;", outputDistanceEquation);
 }
 
 void PrimitiveProcessor::emitCoverage(const GrCCPRCoverageProcessor& proc, GrGLSLFragmentBuilder* f,
@@ -314,11 +316,11 @@
             break;
     }
 
-    f->codeAppendf("%s = vec4(1);", outputCoverage);
+    f->codeAppendf("%s = float4(1);", outputCoverage);
 
 #ifdef SK_DEBUG
     if (proc.debugVisualizations()) {
-        f->codeAppendf("%s = vec4(-%s.a, %s.a, 0, 1);", outputColor, outputColor, outputColor);
+        f->codeAppendf("%s = float4(-%s.a, %s.a, 0, 1);", outputColor, outputColor, outputColor);
     }
 #endif
 }
@@ -327,17 +329,17 @@
                                                   const char* samplesName) const {
     // Standard DX11 sample locations.
 #if defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_IOS)
-    f->defineConstant("highp vec2[8]", samplesName, "vec2[8]("
-        "vec2(+1, -3)/16, vec2(-1, +3)/16, vec2(+5, +1)/16, vec2(-3, -5)/16, "
-        "vec2(-5, +5)/16, vec2(-7, -1)/16, vec2(+3, +7)/16, vec2(+7, -7)/16."
+    f->defineConstant("highp float2[8]", samplesName, "float2[8]("
+        "float2(+1, -3)/16, float2(-1, +3)/16, float2(+5, +1)/16, float2(-3, -5)/16, "
+        "float2(-5, +5)/16, float2(-7, -1)/16, float2(+3, +7)/16, float2(+7, -7)/16."
     ")");
     return 8;
 #else
-    f->defineConstant("highp vec2[16]", samplesName, "vec2[16]("
-        "vec2(+1, +1)/16, vec2(-1, -3)/16, vec2(-3, +2)/16, vec2(+4, -1)/16, "
-        "vec2(-5, -2)/16, vec2(+2, +5)/16, vec2(+5, +3)/16, vec2(+3, -5)/16, "
-        "vec2(-2, +6)/16, vec2( 0, -7)/16, vec2(-4, -6)/16, vec2(-6, +4)/16, "
-        "vec2(-8,  0)/16, vec2(+7, -4)/16, vec2(+6, +7)/16, vec2(-7, -8)/16."
+    f->defineConstant("highp float2[16]", samplesName, "float2[16]("
+        "float2(+1, +1)/16, float2(-1, -3)/16, float2(-3, +2)/16, float2(+4, -1)/16, "
+        "float2(-5, -2)/16, float2(+2, +5)/16, float2(+5, +3)/16, float2(+3, -5)/16, "
+        "float2(-2, +6)/16, float2( 0, -7)/16, float2(-4, -6)/16, float2(-6, +4)/16, "
+        "float2(-8,  0)/16, float2(+7, -4)/16, float2(+6, +7)/16, float2(-7, -8)/16."
     ")");
     return 16;
 #endif
diff --git a/src/gpu/ccpr/GrCCPRCoverageProcessor.h b/src/gpu/ccpr/GrCCPRCoverageProcessor.h
index 574cf4a..befa1a9 100644
--- a/src/gpu/ccpr/GrCCPRCoverageProcessor.h
+++ b/src/gpu/ccpr/GrCCPRCoverageProcessor.h
@@ -215,13 +215,13 @@
     int emitEdgeGeometry(GrGLSLGeometryBuilder*, const char* emitVertexFn, const char* leftPt,
                          const char* rightPt, const char* distanceEquation = nullptr) const;
 
-    // Defines an equation ("dot(vec3(pt, 1), distance_equation)") that is -1 on the outside border
-    // of a conservative raster edge and 0 on the inside (see emitEdgeGeometry).
+    // Defines an equation ("dot(float3(pt, 1), distance_equation)") that is -1 on the outside
+    // border of a conservative raster edge and 0 on the inside (see emitEdgeGeometry).
     void emitEdgeDistanceEquation(GrGLSLGeometryBuilder*, const char* leftPt, const char* rightPt,
                                   const char* outputDistanceEquation) const;
 
-    // Defines a global vec2 array that contains MSAA sample locations as offsets from pixel center.
-    // Subclasses can use this for software multisampling.
+    // Defines a global float2 array that contains MSAA sample locations as offsets from pixel
+    // center. Subclasses can use this for software multisampling.
     //
     // Returns the number of samples.
     int defineSoftSampleLocations(GrGLSLFragmentBuilder*, const char* samplesName) const;
diff --git a/src/gpu/ccpr/GrCCPRCubicProcessor.cpp b/src/gpu/ccpr/GrCCPRCubicProcessor.cpp
index 9dfa8e1..5f6f759 100644
--- a/src/gpu/ccpr/GrCCPRCubicProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPRCubicProcessor.cpp
@@ -24,10 +24,10 @@
 #endif
 
     // Fetch all 4 cubic bezier points.
-    v->codeAppendf("ivec4 indices = ivec4(%s.y, %s.x, %s.x + 1, %s.y + 1);",
+    v->codeAppendf("int4 indices = int4(%s.y, %s.x, %s.x + 1, %s.y + 1);",
                    proc.instanceAttrib(), proc.instanceAttrib(), proc.instanceAttrib(),
                    proc.instanceAttrib());
-    v->codeAppend ("highp mat4x2 bezierpts = mat4x2(");
+    v->codeAppend ("highp float4x2 bezierpts = float4x2(");
     v->appendTexelFetch(pointsBuffer, "indices[sk_VertexID]");
     v->codeAppend (".xy, ");
     v->appendTexelFetch(pointsBuffer, "indices[(sk_VertexID + 1) % 4]");
@@ -38,24 +38,24 @@
     v->codeAppend (".xy);");
 
     // Find the corner of the inset geometry that corresponds to this bezier vertex (bezierpts[0]).
-    v->codeAppend ("highp mat2 N = mat2(bezierpts[3].y - bezierpts[0].y, "
-                                       "bezierpts[0].x - bezierpts[3].x, "
-                                       "bezierpts[1].y - bezierpts[0].y, "
-                                       "bezierpts[0].x - bezierpts[1].x);");
-    v->codeAppend ("highp mat2 P = mat2(bezierpts[3], bezierpts[1]);");
+    v->codeAppend ("highp float2x2 N = float2x2(bezierpts[3].y - bezierpts[0].y, "
+                                               "bezierpts[0].x - bezierpts[3].x, "
+                                               "bezierpts[1].y - bezierpts[0].y, "
+                                               "bezierpts[0].x - bezierpts[1].x);");
+    v->codeAppend ("highp float2x2 P = float2x2(bezierpts[3], bezierpts[1]);");
     v->codeAppend ("if (abs(determinant(N)) < 2) {"); // Area of [pts[3], pts[0], pts[1]] < 1px.
                        // The inset corner doesn't exist because we are effectively colinear with
                        // both neighbor vertices. Just duplicate a neighbor's inset corner.
     v->codeAppend (    "int smallidx = (dot(N[0], N[0]) > dot(N[1], N[1])) ? 1 : 0;");
-    v->codeAppend (    "N[smallidx] = vec2(bezierpts[2].y - bezierpts[3 - smallidx * 2].y, "
-                                          "bezierpts[3 - smallidx * 2].x - bezierpts[2].x);");
+    v->codeAppend (    "N[smallidx] = float2(bezierpts[2].y - bezierpts[3 - smallidx * 2].y, "
+                                            "bezierpts[3 - smallidx * 2].x - bezierpts[2].x);");
     v->codeAppend (    "P[smallidx] = bezierpts[2];");
     v->codeAppend ("}");
     v->codeAppend ("N[0] *= sign(dot(N[0], P[1] - P[0]));");
     v->codeAppend ("N[1] *= sign(dot(N[1], P[0] - P[1]));");
 
-    v->codeAppendf("highp vec2 K = vec2(dot(N[0], P[0] + %f * sign(N[0])), "
-                                       "dot(N[1], P[1] + %f * sign(N[1])));", inset, inset);
+    v->codeAppendf("highp float2 K = float2(dot(N[0], P[0] + %f * sign(N[0])), "
+                                           "dot(N[1], P[1] + %f * sign(N[1])));", inset, inset);
     v->codeAppendf("%s.xy = K * inverse(N) + %s;", fInset.vsOut(), atlasOffset);
     v->codeAppendf("%s.xy = %s.xy * %s.xz + %s.yw;",
                    fInset.vsOut(), fInset.vsOut(), rtAdjust, rtAdjust);
@@ -71,14 +71,15 @@
     v->codeAppend ("[sk_VertexID % 2];");
 
     // Emit the vertex position.
-    v->codeAppendf("highp vec2 self = bezierpts[0] + %s;", atlasOffset);
+    v->codeAppendf("highp float2 self = bezierpts[0] + %s;", atlasOffset);
     gpArgs->fPositionVar.set(kVec2f_GrSLType, "self");
 }
 
 void GrCCPRCubicProcessor::emitWind(GrGLSLGeometryBuilder* g, const char* rtAdjust,
                                     const char* outputWind) const {
     // We will define bezierpts in onEmitGeometryShader.
-    g->codeAppend ("highp float area_times_2 = determinant(mat3(1, bezierpts[0], "
+    g->codeAppend ("highp float area_times_2 = "
+                                          "determinant(float3x3(1, bezierpts[0], "
                                                                "1, bezierpts[2], "
                                                                "0, bezierpts[3] - bezierpts[1]));");
     // Drop curves that are nearly flat. The KLM  math becomes unstable in this case.
@@ -97,13 +98,13 @@
 void GrCCPRCubicProcessor::onEmitGeometryShader(GrGLSLGeometryBuilder* g, const char* emitVertexFn,
                                                 const char* wind, const char* rtAdjust) const {
     // Prepend bezierpts at the start of the shader.
-    g->codePrependf("highp mat4x2 bezierpts = mat4x2(sk_in[0].gl_Position.xy, "
+    g->codePrependf("highp float4x2 bezierpts = float4x2(sk_in[0].gl_Position.xy, "
                                                     "sk_in[1].gl_Position.xy, "
                                                     "sk_in[2].gl_Position.xy, "
                                                     "sk_in[3].gl_Position.xy);");
 
     // Evaluate the cubic at t=.5 for an approximate midpoint.
-    g->codeAppendf("highp vec2 midpoint = bezierpts * vec4(.125, .375, .375, .125);");
+    g->codeAppendf("highp float2 midpoint = bezierpts * float4(.125, .375, .375, .125);");
 
     // Finish finding the inset geometry we started in the vertex shader. The z component tells us
     // how "sharp" an inset corner is. And the vertex shader already skips one corner if it is
@@ -111,9 +112,9 @@
     // geometry is all empty (it should never be non-convex because the curve gets chopped into
     // convex segments ahead of time).
     g->codeAppendf("bool isempty = "
-                       "any(lessThan(vec4(%s[0].z, %s[1].z, %s[2].z, %s[3].z) * %s, vec4(2)));",
+                       "any(lessThan(float4(%s[0].z, %s[1].z, %s[2].z, %s[3].z) * %s, float4(2)));",
                    fInset.gsIn(), fInset.gsIn(), fInset.gsIn(), fInset.gsIn(), wind);
-    g->codeAppendf("highp vec2 inset[4];");
+    g->codeAppendf("highp float2 inset[4];");
     g->codeAppend ("for (int i = 0; i < 4; ++i) {");
     g->codeAppendf(    "inset[i] = isempty ? midpoint : %s[i].xy;", fInset.gsIn());
     g->codeAppend ("}");
@@ -127,8 +128,8 @@
     g->codeAppend ("lowp int numbackwards = 0;");
     g->codeAppend ("for (int i = 0; i < 4; ++i) {");
     g->codeAppend (    "lowp int j = (i + 1) % 4;");
-    g->codeAppendf(    "highp vec2 inner = inset[j] - inset[i];");
-    g->codeAppendf(    "highp vec2 outer = sk_in[j].gl_Position.xy - sk_in[i].gl_Position.xy;");
+    g->codeAppendf(    "highp float2 inner = inset[j] - inset[i];");
+    g->codeAppendf(    "highp float2 outer = sk_in[j].gl_Position.xy - sk_in[i].gl_Position.xy;");
     g->codeAppendf(    "backwards[i] = sign(dot(outer, inner));");
     g->codeAppendf(    "numbackwards += backwards[i] < 0 ? 1 : 0;");
     g->codeAppend ("}");
@@ -137,16 +138,16 @@
     // dropped on the floor later.
     g->codeAppend ("lowp int x = (backwards[0] != backwards[2]) ? 1 : 0;");
     g->codeAppend ("lowp int x3 = (x + 3) % 4;");
-    g->codeAppend ("highp mat2 X = mat2(inset[x].y - inset[x+1].y, "
-                                       "inset[x+1].x - inset[x].x, "
-                                       "inset[x+2].y - inset[x3].y, "
-                                       "inset[x3].x - inset[x+2].x);");
-    g->codeAppend ("highp vec2 KK = vec2(dot(X[0], inset[x]), dot(X[1], inset[x+2]));");
-    g->codeAppend ("highp vec2 crossoverpoint = KK * inverse(X);");
+    g->codeAppend ("highp float2x2 X = float2x2(inset[x].y - inset[x+1].y, "
+                                               "inset[x+1].x - inset[x].x, "
+                                               "inset[x+2].y - inset[x3].y, "
+                                               "inset[x3].x - inset[x+2].x);");
+    g->codeAppend ("highp float2 KK = float2(dot(X[0], inset[x]), dot(X[1], inset[x+2]));");
+    g->codeAppend ("highp float2 crossoverpoint = KK * inverse(X);");
 
     // Determine what point backwards edges should collapse into. If there is one backwards edge,
     // it should collapse to the crossover point. If >1, they should all collapse to the midpoint.
-    g->codeAppend ("highp vec2 collapsepoint = numbackwards == 1 ? crossoverpoint : midpoint;");
+    g->codeAppend ("highp float2 collapsepoint = numbackwards == 1 ? crossoverpoint : midpoint;");
 
     // Collapse backwards egdes to the "collapse" point.
     g->codeAppend ("for (int i = 0; i < 4; ++i) {");
@@ -157,46 +158,46 @@
 
     // Calculate the KLM matrix.
     g->declareGlobal(fKLMMatrix);
-    g->codeAppend ("highp vec4 K, L, M;");
+    g->codeAppend ("highp float4 K, L, M;");
     if (Type::kSerpentine == fType) {
-        g->codeAppend ("highp vec2 l,m;");
-        g->codeAppendf("l.ts = vec2(%s[0], %s[1]);", fTS.gsIn(), fTS.gsIn());
-        g->codeAppendf("m.ts = vec2(%s[2], %s[3]);", fTS.gsIn(), fTS.gsIn());
-        g->codeAppend ("K = vec4(0, l.s * m.s, -l.t * m.s - m.t * l.s, l.t * m.t);");
-        g->codeAppend ("L = vec4(-1,3,-3,1) * l.ssst * l.sstt * l.sttt;");
-        g->codeAppend ("M = vec4(-1,3,-3,1) * m.ssst * m.sstt * m.sttt;");
+        g->codeAppend ("highp float2 l,m;");
+        g->codeAppendf("l.ts = float2(%s[0], %s[1]);", fTS.gsIn(), fTS.gsIn());
+        g->codeAppendf("m.ts = float2(%s[2], %s[3]);", fTS.gsIn(), fTS.gsIn());
+        g->codeAppend ("K = float4(0, l.s * m.s, -l.t * m.s - m.t * l.s, l.t * m.t);");
+        g->codeAppend ("L = float4(-1,3,-3,1) * l.ssst * l.sstt * l.sttt;");
+        g->codeAppend ("M = float4(-1,3,-3,1) * m.ssst * m.sstt * m.sttt;");
 
     } else {
-        g->codeAppend ("highp vec2 d,e;");
-        g->codeAppendf("d.ts = vec2(%s[0], %s[1]);", fTS.gsIn(), fTS.gsIn());
-        g->codeAppendf("e.ts = vec2(%s[2], %s[3]);", fTS.gsIn(), fTS.gsIn());
-        g->codeAppend ("highp vec4 dxe = vec4(d.s * e.s, d.s * e.t, d.t * e.s, d.t * e.t);");
-        g->codeAppend ("K = vec4(0, dxe.x, -dxe.y - dxe.z, dxe.w);");
-        g->codeAppend ("L = vec4(-1,1,-1,1) * d.sstt * (dxe.xyzw + vec4(0, 2*dxe.zy, 0));");
-        g->codeAppend ("M = vec4(-1,1,-1,1) * e.sstt * (dxe.xzyw + vec4(0, 2*dxe.yz, 0));");
+        g->codeAppend ("highp float2 d,e;");
+        g->codeAppendf("d.ts = float2(%s[0], %s[1]);", fTS.gsIn(), fTS.gsIn());
+        g->codeAppendf("e.ts = float2(%s[2], %s[3]);", fTS.gsIn(), fTS.gsIn());
+        g->codeAppend ("highp float4 dxe = float4(d.s * e.s, d.s * e.t, d.t * e.s, d.t * e.t);");
+        g->codeAppend ("K = float4(0, dxe.x, -dxe.y - dxe.z, dxe.w);");
+        g->codeAppend ("L = float4(-1,1,-1,1) * d.sstt * (dxe.xyzw + float4(0, 2*dxe.zy, 0));");
+        g->codeAppend ("M = float4(-1,1,-1,1) * e.sstt * (dxe.xzyw + float4(0, 2*dxe.yz, 0));");
     }
 
-    g->codeAppend ("highp mat2x4 C = mat4(-1,  3, -3,  1, "
-                                         " 3, -6,  3,  0, "
-                                         "-3,  3,  0,  0, "
-                                         " 1,  0,  0,  0) * transpose(bezierpts);");
+    g->codeAppend ("highp float2x4 C = float4x4(-1,  3, -3,  1, "
+                                               " 3, -6,  3,  0, "
+                                               "-3,  3,  0,  0, "
+                                               " 1,  0,  0,  0) * transpose(bezierpts);");
 
-    g->codeAppend ("highp vec2 absdet = abs(C[0].xx * C[1].zy - C[1].xx * C[0].zy);");
+    g->codeAppend ("highp float2 absdet = abs(C[0].xx * C[1].zy - C[1].xx * C[0].zy);");
     g->codeAppend ("lowp int middlerow = absdet[0] > absdet[1] ? 2 : 1;");
 
-    g->codeAppend ("highp mat3 CI = inverse(mat3(C[0][0], C[0][middlerow], C[0][3], "
-                                                "C[1][0], C[1][middlerow], C[1][3], "
-                                                "      0,               0,       1));");
-    g->codeAppendf("%s = CI * mat3(K[0], K[middlerow], K[3], "
-                                  "L[0], L[middlerow], L[3], "
-                                  "M[0], M[middlerow], M[3]);", fKLMMatrix.c_str());
+    g->codeAppend ("highp float3x3 CI = inverse(float3x3(C[0][0], C[0][middlerow], C[0][3], "
+                                                        "C[1][0], C[1][middlerow], C[1][3], "
+                                                        "      0,               0,       1));");
+    g->codeAppendf("%s = CI * float3x3(K[0], K[middlerow], K[3], "
+                                      "L[0], L[middlerow], L[3], "
+                                      "M[0], M[middlerow], M[3]);", fKLMMatrix.c_str());
 
     // Orient the KLM matrix so we fill the correct side of the curve.
-    g->codeAppendf("lowp vec2 orientation = sign(vec3(midpoint, 1) * mat2x3(%s[1], %s[2]));",
+    g->codeAppendf("lowp float2 orientation = sign(float3(midpoint, 1) * float2x3(%s[1], %s[2]));",
                    fKLMMatrix.c_str(), fKLMMatrix.c_str());
-    g->codeAppendf("%s *= mat3(orientation[0] * orientation[1], 0, 0, "
-                              "0, orientation[0], 0, "
-                              "0, 0, orientation[1]);", fKLMMatrix.c_str());
+    g->codeAppendf("%s *= float3x3(orientation[0] * orientation[1], 0, 0, "
+                                  "0, orientation[0], 0, "
+                                  "0, 0, orientation[1]);", fKLMMatrix.c_str());
 
     g->declareGlobal(fKLMDerivatives);
     g->codeAppendf("%s[0] = %s[0].xy * %s.xz;",
@@ -227,7 +228,7 @@
 void GrCCPRCubicInsetProcessor::emitPerVertexGeometryCode(SkString* fnBody, const char* position,
                                                           const char* /*coverage*/,
                                                           const char* /*wind*/) const {
-    fnBody->appendf("highp vec3 klm = vec3(%s, 1) * %s;", position, fKLMMatrix.c_str());
+    fnBody->appendf("highp float3 klm = float3(%s, 1) * %s;", position, fKLMMatrix.c_str());
     fnBody->appendf("%s = klm;", fKLM.gsOut());
     fnBody->appendf("%s[0] = 3 * klm[0] * %s[0];", fGradMatrix.gsOut(), fKLMDerivatives.c_str());
     fnBody->appendf("%s[1] = -klm[1] * %s[2].xy - klm[2] * %s[1].xy;",
@@ -239,7 +240,7 @@
     f->codeAppendf("highp float k = %s.x, l = %s.y, m = %s.z;",
                    fKLM.fsIn(), fKLM.fsIn(), fKLM.fsIn());
     f->codeAppend ("highp float f = k*k*k - l*m;");
-    f->codeAppendf("highp vec2 grad = %s * vec2(k, 1);", fGradMatrix.fsIn());
+    f->codeAppendf("highp float2 grad = %s * float2(k, 1);", fGradMatrix.fsIn());
     f->codeAppend ("highp float d = f * inversesqrt(dot(grad, grad));");
     f->codeAppendf("%s = clamp(0.5 - d, 0, 1);", outputCoverage);
 }
@@ -250,8 +251,8 @@
     // We defined bezierpts in onEmitGeometryShader.
     g->declareGlobal(fEdgeDistanceEquation);
     g->codeAppendf("int edgeidx0 = %s > 0 ? 3 : 0;", wind);
-    g->codeAppendf("highp vec2 edgept0 = bezierpts[edgeidx0];");
-    g->codeAppendf("highp vec2 edgept1 = bezierpts[3 - edgeidx0];");
+    g->codeAppendf("highp float2 edgept0 = bezierpts[edgeidx0];");
+    g->codeAppendf("highp float2 edgept1 = bezierpts[3 - edgeidx0];");
     this->emitEdgeDistanceEquation(g, "edgept0", "edgept1", fEdgeDistanceEquation.c_str());
     g->codeAppendf("%s.z += 0.5;", fEdgeDistanceEquation.c_str()); // outer = -.5, inner = .5
 
@@ -260,9 +261,9 @@
                    fEdgeDistanceDerivatives.c_str(), fEdgeDistanceEquation.c_str(), rtAdjust);
 
     g->declareGlobal(fEdgeSpaceTransform);
-    g->codeAppend ("highp vec4 edgebbox = vec4(min(bezierpts[0], bezierpts[3]) - bloat, "
+    g->codeAppend ("highp float4 edgebbox = float4(min(bezierpts[0], bezierpts[3]) - bloat, "
                                               "max(bezierpts[0], bezierpts[3]) + bloat);");
-    g->codeAppendf("%s.xy = 2 / vec2(edgebbox.zw - edgebbox.xy);", fEdgeSpaceTransform.c_str());
+    g->codeAppendf("%s.xy = 2 / float2(edgebbox.zw - edgebbox.xy);", fEdgeSpaceTransform.c_str());
     g->codeAppendf("%s.zw = -1 - %s.xy * edgebbox.xy;",
                    fEdgeSpaceTransform.c_str(), fEdgeSpaceTransform.c_str());
 
@@ -277,14 +278,14 @@
 void GrCCPRCubicBorderProcessor::emitPerVertexGeometryCode(SkString* fnBody, const char* position,
                                                            const char* /*coverage*/,
                                                            const char* /*wind*/) const {
-    fnBody->appendf("highp vec3 klm = vec3(%s, 1) * %s;", position, fKLMMatrix.c_str());
-    fnBody->appendf("highp float d = dot(vec3(%s, 1), %s);",
+    fnBody->appendf("highp float3 klm = float3(%s, 1) * %s;", position, fKLMMatrix.c_str());
+    fnBody->appendf("highp float d = dot(float3(%s, 1), %s);",
                     position, fEdgeDistanceEquation.c_str());
-    fnBody->appendf("%s = vec4(klm, d);", fKLMD.gsOut());
-    fnBody->appendf("%s = vec4(%s[0].x, %s[1].x, %s[2].x, %s.x);",
+    fnBody->appendf("%s = float4(klm, d);", fKLMD.gsOut());
+    fnBody->appendf("%s = float4(%s[0].x, %s[1].x, %s[2].x, %s.x);",
                     fdKLMDdx.gsOut(), fKLMDerivatives.c_str(), fKLMDerivatives.c_str(),
                     fKLMDerivatives.c_str(), fEdgeDistanceDerivatives.c_str());
-    fnBody->appendf("%s = vec4(%s[0].y, %s[1].y, %s[2].y, %s.y);",
+    fnBody->appendf("%s = float4(%s[0].y, %s[1].y, %s[2].y, %s.y);",
                     fdKLMDdy.gsOut(), fKLMDerivatives.c_str(), fKLMDerivatives.c_str(),
                     fKLMDerivatives.c_str(), fEdgeDistanceDerivatives.c_str());
     fnBody->appendf("%s = position * %s.xy + %s.zw;", fEdgeSpaceCoord.gsOut(),
@@ -302,18 +303,19 @@
     // Along the shared edge, we start with distance-to-edge coverage, then subtract out the
     // remaining pixel coverage that is still inside the shared edge, but outside the curve.
     // Outside the shared edege, we just use standard msaa to count samples inside the curve.
-    f->codeAppendf("bool use_edge = all(lessThan(abs(%s), vec2(1)));", fEdgeSpaceCoord.fsIn());
+    f->codeAppendf("bool use_edge = all(lessThan(abs(%s), float2(1)));", fEdgeSpaceCoord.fsIn());
     f->codeAppendf("%s = (use_edge ? clamp(%s.w + 0.5, 0, 1) : 0) * %i;",
                    outputCoverage, fKLMD.fsIn(), sampleCount);
 
-    f->codeAppendf("highp mat2x4 grad_klmd = mat2x4(%s, %s);", fdKLMDdx.fsIn(), fdKLMDdy.fsIn());
+    f->codeAppendf("highp float2x4 grad_klmd = float2x4(%s, %s);", fdKLMDdx.fsIn(),
+                   fdKLMDdy.fsIn());
 
     f->codeAppendf("for (int i = 0; i < %i; ++i) {", sampleCount);
-    f->codeAppendf(    "highp vec4 klmd = grad_klmd * samples[i] + %s;", fKLMD.fsIn());
+    f->codeAppendf(    "highp float4 klmd = grad_klmd * samples[i] + %s;", fKLMD.fsIn());
     f->codeAppend (    "lowp float f = klmd.y * klmd.z - klmd.x * klmd.x * klmd.x;");
     // A sample is inside our cubic sub-section if it is inside the implicit AND L & M are both
     // positive. This works because the sections get chopped at the K/L and K/M intersections.
-    f->codeAppend (    "bvec4 inside = greaterThan(vec4(f,klmd.yzw), vec4(0));");
+    f->codeAppend (    "bool4 inside = greaterThan(float4(f,klmd.yzw), float4(0));");
     f->codeAppend (    "lowp float in_curve = all(inside.xyz) ? 1 : 0;");
     f->codeAppend (    "lowp float in_edge = inside.w ? 1 : 0;");
     f->codeAppendf(    "%s += use_edge ? in_edge * (in_curve - 1) : in_curve;", outputCoverage);
diff --git a/src/gpu/ccpr/GrCCPRPathProcessor.cpp b/src/gpu/ccpr/GrCCPRPathProcessor.cpp
index 6efaecf..1292553 100644
--- a/src/gpu/ccpr/GrCCPRPathProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPRPathProcessor.cpp
@@ -136,41 +136,41 @@
     // Find the intersections of (bloated) devBounds and devBounds45 in order to come up with an
     // octagon that circumscribes the (bloated) path. A vertex is the intersection of two lines:
     // one edge from the path's bounding box and one edge from its 45-degree bounding box.
-    v->codeAppendf("highp mat2 N = mat2(%s);", proc.getEdgeNormsAttrib().fName);
+    v->codeAppendf("highp float2x2 N = float2x2(%s);", proc.getEdgeNormsAttrib().fName);
 
     // N[0] is the normal for the edge we are intersecting from the regular bounding box, pointing
     // out of the octagon.
-    v->codeAppendf("highp vec2 refpt = (min(N[0].x, N[0].y) < 0) ? %s.xy : %s.zw;",
+    v->codeAppendf("highp float2 refpt = (min(N[0].x, N[0].y) < 0) ? %s.xy : %s.zw;",
                    proc.getInstanceAttrib(InstanceAttribs::kDevBounds).fName,
                    proc.getInstanceAttrib(InstanceAttribs::kDevBounds).fName);
     v->codeAppendf("refpt += N[0] * %f;", kAABloatRadius); // bloat for AA.
 
     // N[1] is the normal for the edge we are intersecting from the 45-degree bounding box, pointing
     // out of the octagon.
-    v->codeAppendf("highp vec2 refpt45 = (N[1].x < 0) ? %s.xy : %s.zw;",
+    v->codeAppendf("highp float2 refpt45 = (N[1].x < 0) ? %s.xy : %s.zw;",
                    proc.getInstanceAttrib(InstanceAttribs::kDevBounds45).fName,
                    proc.getInstanceAttrib(InstanceAttribs::kDevBounds45).fName);
-    v->codeAppendf("refpt45 *= mat2(.5,.5,-.5,.5);"); // transform back to device space.
+    v->codeAppendf("refpt45 *= float2x2(.5,.5,-.5,.5);"); // transform back to device space.
     v->codeAppendf("refpt45 += N[1] * %f;", kAABloatRadius); // bloat for AA.
 
-    v->codeAppend ("highp vec2 K = vec2(dot(N[0], refpt), dot(N[1], refpt45));");
-    v->codeAppendf("highp vec2 octocoord = K * inverse(N);");
+    v->codeAppend ("highp float2 K = float2(dot(N[0], refpt), dot(N[1], refpt45));");
+    v->codeAppendf("highp float2 octocoord = K * inverse(N);");
 
     gpArgs->fPositionVar.set(kVec2f_GrSLType, "octocoord");
 
     // Convert to atlas coordinates in order to do our texture lookup.
-    v->codeAppendf("highp vec2 atlascoord = octocoord + vec2(%s);",
+    v->codeAppendf("highp float2 atlascoord = octocoord + float2(%s);",
                    proc.getInstanceAttrib(InstanceAttribs::kAtlasOffset).fName);
     if (kTopLeft_GrSurfaceOrigin == proc.atlasProxy()->origin()) {
         v->codeAppendf("%s = atlascoord * %s;", texcoord.vsOut(), atlasAdjust);
     } else {
         SkASSERT(kBottomLeft_GrSurfaceOrigin == proc.atlasProxy()->origin());
-        v->codeAppendf("%s = vec2(atlascoord.x * %s.x, 1 - atlascoord.y * %s.y);",
+        v->codeAppendf("%s = float2(atlascoord.x * %s.x, 1 - atlascoord.y * %s.y);",
                        texcoord.vsOut(), atlasAdjust, atlasAdjust);
     }
 
     // Convert to (local) path cordinates.
-    v->codeAppendf("highp vec2 pathcoord = inverse(mat2(%s)) * (octocoord - %s);",
+    v->codeAppendf("highp float2 pathcoord = inverse(float2x2(%s)) * (octocoord - %s);",
                    proc.getInstanceAttrib(InstanceAttribs::kViewMatrix).fName,
                    proc.getInstanceAttrib(InstanceAttribs::kViewTranslate).fName);
 
@@ -185,11 +185,11 @@
     f->codeAppend (".a;");
 
     if (SkPath::kWinding_FillType == proc.fillType()) {
-        f->codeAppendf("%s = vec4(min(abs(coverage_count), 1));", args.fOutputCoverage);
+        f->codeAppendf("%s = float4(min(abs(coverage_count), 1));", args.fOutputCoverage);
     } else {
         SkASSERT(SkPath::kEvenOdd_FillType == proc.fillType());
         f->codeAppend ("mediump float t = mod(abs(coverage_count), 2);");
-        f->codeAppendf("%s = vec4(1 - abs(t - 1));", args.fOutputCoverage);
+        f->codeAppendf("%s = float4(1 - abs(t - 1));", args.fOutputCoverage);
     }
 }
 
diff --git a/src/gpu/ccpr/GrCCPRQuadraticProcessor.cpp b/src/gpu/ccpr/GrCCPRQuadraticProcessor.cpp
index 8c58ea2..bc09fea 100644
--- a/src/gpu/ccpr/GrCCPRQuadraticProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPRQuadraticProcessor.cpp
@@ -16,9 +16,9 @@
                                                   const TexelBufferHandle& pointsBuffer,
                                                   const char* atlasOffset, const char* rtAdjust,
                                                   GrGPArgs* gpArgs) const {
-    v->codeAppendf("ivec3 indices = ivec3(%s.y, %s.x, %s.y + 1);",
+    v->codeAppendf("int3 indices = int3(%s.y, %s.x, %s.y + 1);",
                    proc.instanceAttrib(), proc.instanceAttrib(), proc.instanceAttrib());
-    v->codeAppend ("highp vec2 self = ");
+    v->codeAppend ("highp float2 self = ");
     v->appendTexelFetch(pointsBuffer, "indices[sk_VertexID]");
     v->codeAppendf(".xy + %s;", atlasOffset);
     gpArgs->fPositionVar.set(kVec2f_GrSLType, "self");
@@ -27,8 +27,9 @@
 void GrCCPRQuadraticProcessor::emitWind(GrGLSLGeometryBuilder* g, const char* rtAdjust,
                                         const char* outputWind) const {
     // We will define bezierpts in onEmitGeometryShader.
-    g->codeAppend ("highp float area_times_2 = determinant(mat2(bezierpts[1] - bezierpts[0], "
-                                                               "bezierpts[2] - bezierpts[0]));");
+    g->codeAppend ("highp float area_times_2 = "
+                                             "determinant(float2x2(bezierpts[1] - bezierpts[0], "
+                                                                  "bezierpts[2] - bezierpts[0]));");
     // Drop curves that are nearly flat, in favor of the higher quality triangle antialiasing.
     g->codeAppendf("if (2 * abs(area_times_2) < length((bezierpts[2] - bezierpts[0]) * %s.zx)) {",
                    rtAdjust);
@@ -46,21 +47,21 @@
                                                     const char* emitVertexFn, const char* wind,
                                                     const char* rtAdjust) const {
     // Prepend bezierpts at the start of the shader.
-    g->codePrependf("highp mat3x2 bezierpts = mat3x2(sk_in[0].gl_Position.xy, "
-                                                    "sk_in[1].gl_Position.xy, "
-                                                    "sk_in[2].gl_Position.xy);");
+    g->codePrependf("highp float3x2 bezierpts = float3x2(sk_in[0].gl_Position.xy, "
+                                                        "sk_in[1].gl_Position.xy, "
+                                                        "sk_in[2].gl_Position.xy);");
 
     g->declareGlobal(fCanonicalMatrix);
-    g->codeAppendf("%s = mat3(0.0, 0, 1, "
-                             "0.5, 0, 1, "
-                             "1.0, 1, 1) * "
-                        "inverse(mat3(bezierpts[0], 1, "
-                                     "bezierpts[1], 1, "
-                                     "bezierpts[2], 1));",
+    g->codeAppendf("%s = float3x3(0.0, 0, 1, "
+                                 "0.5, 0, 1, "
+                                 "1.0, 1, 1) * "
+                        "inverse(float3x3(bezierpts[0], 1, "
+                                         "bezierpts[1], 1, "
+                                         "bezierpts[2], 1));",
                    fCanonicalMatrix.c_str());
 
     g->declareGlobal(fCanonicalDerivatives);
-    g->codeAppendf("%s = mat2(%s) * mat2(%s.x, 0, 0, %s.z);",
+    g->codeAppendf("%s = float2x2(%s) * float2x2(%s.x, 0, 0, %s.z);",
                    fCanonicalDerivatives.c_str(), fCanonicalMatrix.c_str(), rtAdjust, rtAdjust);
 
     this->emitQuadraticGeometry(g, emitVertexFn, wind, rtAdjust);
@@ -69,10 +70,10 @@
 void GrCCPRQuadraticProcessor::emitPerVertexGeometryCode(SkString* fnBody, const char* position,
                                                          const char* /*coverage*/,
                                                          const char* /*wind*/) const {
-    fnBody->appendf("%s.xy = (%s * vec3(%s, 1)).xy;",
+    fnBody->appendf("%s.xy = (%s * float3(%s, 1)).xy;",
                     fCanonicalCoord.gsOut(), fCanonicalMatrix.c_str(), position);
-    fnBody->appendf("%s.zw = vec2(2 * %s.x * %s[0].x - %s[0].y, "
-                                 "2 * %s.x * %s[1].x - %s[1].y);",
+    fnBody->appendf("%s.zw = float2(2 * %s.x * %s[0].x - %s[0].y, "
+                                   "2 * %s.x * %s[1].x - %s[1].y);",
                     fCanonicalCoord.gsOut(), fCanonicalCoord.gsOut(),
                     fCanonicalDerivatives.c_str(), fCanonicalDerivatives.c_str(),
                     fCanonicalCoord.gsOut(), fCanonicalDerivatives.c_str(),
@@ -93,26 +94,26 @@
                                                          const char* rtAdjust) const {
     // Find the point on the curve whose tangent is halfway between the tangents at the endpionts.
     // We defined bezierpts in onEmitGeometryShader.
-    g->codeAppend ("highp vec2 n = (normalize(bezierpts[0] - bezierpts[1]) + "
-                                   "normalize(bezierpts[2] - bezierpts[1]));");
+    g->codeAppend ("highp float2 n = (normalize(bezierpts[0] - bezierpts[1]) + "
+                                     "normalize(bezierpts[2] - bezierpts[1]));");
     g->codeAppend ("highp float t = dot(bezierpts[0] - bezierpts[1], n) / "
                                    "dot(bezierpts[2] - 2 * bezierpts[1] + bezierpts[0], n);");
-    g->codeAppend ("highp vec2 pt = (1 - t) * (1 - t) * bezierpts[0] + "
-                                   "2 * t * (1 - t) * bezierpts[1] + "
-                                   "t * t * bezierpts[2];");
+    g->codeAppend ("highp float2 pt = (1 - t) * (1 - t) * bezierpts[0] + "
+                                      "2 * t * (1 - t) * bezierpts[1] + "
+                                      "t * t * bezierpts[2];");
 
     // Clip the triangle by the tangent line at this halfway point.
-    g->codeAppend ("highp mat2 v = mat2(bezierpts[0] - bezierpts[1], "
-                                       "bezierpts[2] - bezierpts[1]);");
-    g->codeAppend ("highp vec2 nv = n * v;");
-    g->codeAppend ("highp vec2 d = abs(nv[0]) > 0.1 * max(bloat.x, bloat.y) ? "
-                                  "(dot(n, pt - bezierpts[1])) / nv : vec2(0);");
+    g->codeAppend ("highp float2x2 v = float2x2(bezierpts[0] - bezierpts[1], "
+                                               "bezierpts[2] - bezierpts[1]);");
+    g->codeAppend ("highp float2 nv = n * v;");
+    g->codeAppend ("highp float2 d = abs(nv[0]) > 0.1 * max(bloat.x, bloat.y) ? "
+                                    "(dot(n, pt - bezierpts[1])) / nv : float2(0);");
 
     // Generate a 4-point hull of the curve from the clipped triangle.
-    g->codeAppendf("highp mat4x2 quadratic_hull = mat4x2(bezierpts[0], "
-                                                        "bezierpts[1] + d[0] * v[0], "
-                                                        "bezierpts[1] + d[1] * v[1], "
-                                                        "bezierpts[2]);");
+    g->codeAppendf("highp float4x2 quadratic_hull = float4x2(bezierpts[0], "
+                                                            "bezierpts[1] + d[0] * v[0], "
+                                                            "bezierpts[1] + d[1] * v[1], "
+                                                            "bezierpts[2]);");
 
     int maxVerts = this->emitHullGeometry(g, emitVertexFn, "quadratic_hull", 4, "sk_InvocationID");
 
@@ -127,9 +128,9 @@
                                                                const char* rtAdjust) const {
     // We defined bezierpts in onEmitGeometryShader.
     g->codeAppendf("int leftidx = %s > 0 ? 2 : 0;", wind);
-    g->codeAppendf("highp vec2 left = bezierpts[leftidx];");
-    g->codeAppendf("highp vec2 right = bezierpts[2 - leftidx];");
-    this->emitEdgeDistanceEquation(g, "left", "right", "highp vec3 edge_distance_equation");
+    g->codeAppendf("highp float2 left = bezierpts[leftidx];");
+    g->codeAppendf("highp float2 right = bezierpts[2 - leftidx];");
+    this->emitEdgeDistanceEquation(g, "left", "right", "highp float3 edge_distance_equation");
 
     g->declareGlobal(fEdgeDistanceDerivatives);
     g->codeAppendf("%s = edge_distance_equation.xy * %s.xz;",
@@ -163,16 +164,16 @@
     // shared edge, but outside the curve.
     int sampleCount = this->defineSoftSampleLocations(f, "samples");
 
-    f->codeAppendf("highp mat2x3 grad_xyd = mat2x3(%s[0],%s.y, %s[1],%s.z);",
+    f->codeAppendf("highp float2x3 grad_xyd = float2x3(%s[0],%s.y, %s[1],%s.z);",
                    fFragCanonicalDerivatives.fsIn(), fEdgeDistance.fsIn(),
                    fFragCanonicalDerivatives.fsIn(), fEdgeDistance.fsIn());
-    f->codeAppendf("highp vec3 center_xyd = vec3(%s.xy, %s.x);",
+    f->codeAppendf("highp float3 center_xyd = float3(%s.xy, %s.x);",
                    fCanonicalCoord.fsIn(), fEdgeDistance.fsIn());
 
     f->codeAppendf("for (int i = 0; i < %i; ++i) {", sampleCount);
-    f->codeAppend (    "highp vec3 xyd = grad_xyd * samples[i] + center_xyd;");
+    f->codeAppend (    "highp float3 xyd = grad_xyd * samples[i] + center_xyd;");
     f->codeAppend (    "lowp float f = xyd.x * xyd.x - xyd.y;"); // f > 0 -> outside curve.
-    f->codeAppend (    "bvec2 outside_curve_inside_edge = greaterThan(vec2(f, xyd.z), vec2(0));");
+    f->codeAppend (    "bool2 outside_curve_inside_edge = greaterThan(float2(f, xyd.z), float2(0));");
     f->codeAppendf(    "%s -= all(outside_curve_inside_edge) ? %f : 0;",
                        outputCoverage, 1.0 / sampleCount);
     f->codeAppendf("}");
diff --git a/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp b/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp
index 23f7b14..77da2cf 100644
--- a/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPRTriangleProcessor.cpp
@@ -16,7 +16,7 @@
                                                  const TexelBufferHandle& pointsBuffer,
                                                  const char* atlasOffset, const char* rtAdjust,
                                                  GrGPArgs* gpArgs) const {
-    v->codeAppend ("highp vec2 self = ");
+    v->codeAppend ("highp float2 self = ");
     v->appendTexelFetch(pointsBuffer,
                         SkStringPrintf("%s[sk_VertexID]", proc.instanceAttrib()).c_str());
     v->codeAppendf(".xy + %s;", atlasOffset);
@@ -25,16 +25,17 @@
 
 void GrCCPRTriangleProcessor::defineInputVertices(GrGLSLGeometryBuilder* g) const {
     // Prepend in_vertices at the start of the shader.
-    g->codePrependf("highp mat3x2 in_vertices = mat3x2(sk_in[0].gl_Position.xy, "
-                                                      "sk_in[1].gl_Position.xy, "
-                                                      "sk_in[2].gl_Position.xy);");
+    g->codePrependf("highp float3x2 in_vertices = float3x2(sk_in[0].gl_Position.xy, "
+                                                          "sk_in[1].gl_Position.xy, "
+                                                          "sk_in[2].gl_Position.xy);");
 }
 
 void GrCCPRTriangleProcessor::emitWind(GrGLSLGeometryBuilder* g, const char* /*rtAdjust*/,
                                        const char* outputWind) const {
     // We will define in_vertices in defineInputVertices.
-    g->codeAppendf("%s = sign(determinant(mat2(in_vertices[1] - in_vertices[0], "
-                                              "in_vertices[2] - in_vertices[0])));", outputWind);
+    g->codeAppendf("%s = sign(determinant(float2x2(in_vertices[1] - in_vertices[0], "
+                                                  "in_vertices[2] - in_vertices[0])));",
+                   outputWind);
 }
 
 void GrCCPRTriangleHullAndEdgeProcessor::onEmitGeometryShader(GrGLSLGeometryBuilder* g,
@@ -52,8 +53,8 @@
     if (GeometryType::kHulls != fGeometryType) {
         g->codeAppend ("int edgeidx0 = sk_InvocationID, "
                            "edgeidx1 = (edgeidx0 + 1) % 3;");
-        g->codeAppendf("highp vec2 edgept0 = in_vertices[%s > 0 ? edgeidx0 : edgeidx1];", wind);
-        g->codeAppendf("highp vec2 edgept1 = in_vertices[%s > 0 ? edgeidx1 : edgeidx0];", wind);
+        g->codeAppendf("highp float2 edgept0 = in_vertices[%s > 0 ? edgeidx0 : edgeidx1];", wind);
+        g->codeAppendf("highp float2 edgept1 = in_vertices[%s > 0 ? edgeidx1 : edgeidx0];", wind);
 
         maxOutputVertices += this->emitEdgeGeometry(g, emitVertexFn, "edgept0", "edgept1");
     }
@@ -72,16 +73,17 @@
     this->INHERITED::onEmitVertexShader(proc, v, pointsBuffer, atlasOffset, rtAdjust, gpArgs);
 
     // Fetch and transform the next point in the triangle.
-    v->codeAppend ("highp vec2 next = ");
+    v->codeAppend ("highp float2 next = ");
     v->appendTexelFetch(pointsBuffer,
                         SkStringPrintf("%s[(sk_VertexID+1) %% 3]", proc.instanceAttrib()).c_str());
     v->codeAppendf(".xy + %s;", atlasOffset);
 
     // Find the plane that gives distance from the [self -> next] edge, normalized to its AA
     // bloat width.
-    v->codeAppend ("highp vec2 n = vec2(next.y - self.y, self.x - next.x);");
-    v->codeAppendf("highp vec2 d = n * mat2(self + %f * sign(n), "
-                                           "self - %f * sign(n));", kAABloatRadius, kAABloatRadius);
+    v->codeAppend ("highp float2 n = float2(next.y - self.y, self.x - next.x);");
+    v->codeAppendf("highp float2 d = n * float2x2(self + %f * sign(n), "
+                                                 "self - %f * sign(n));",
+                   kAABloatRadius, kAABloatRadius);
 
     // Clamp for when n=0. (wind=0 when n=0, so as long as we don't get Inf or NaN we are fine.)
     v->codeAppendf("%s.xy = n / max(d[0] - d[1], 1e-30);", fEdgeDistance.vsOut());
@@ -96,11 +98,11 @@
                                                          const char* rtAdjust) const {
     this->defineInputVertices(g);
 
-    g->codeAppend ("highp vec2 self = in_vertices[sk_InvocationID];");
-    g->codeAppendf("%s(self + vec2(-bloat.x, -bloat.y), 1);", emitVertexFn);
-    g->codeAppendf("%s(self + vec2(-bloat.x, +bloat.y), 1);", emitVertexFn);
-    g->codeAppendf("%s(self + vec2(+bloat.x, -bloat.y), 1);", emitVertexFn);
-    g->codeAppendf("%s(self + vec2(+bloat.x, +bloat.y), 1);", emitVertexFn);
+    g->codeAppend ("highp float2 self = in_vertices[sk_InvocationID];");
+    g->codeAppendf("%s(self + float2(-bloat.x, -bloat.y), 1);", emitVertexFn);
+    g->codeAppendf("%s(self + float2(-bloat.x, +bloat.y), 1);", emitVertexFn);
+    g->codeAppendf("%s(self + float2(+bloat.x, -bloat.y), 1);", emitVertexFn);
+    g->codeAppendf("%s(self + float2(+bloat.x, +bloat.y), 1);", emitVertexFn);
     g->codeAppend ("EndPrimitive();");
 
     g->configure(GrGLSLGeometryBuilder::InputType::kTriangles,
@@ -116,13 +118,13 @@
                     fNeighbors.gsOut(), fDevCoord.gsIn());
     fnBody->appendf("%s.zw = %s[(sk_InvocationID + 2) %% 3];",
                     fNeighbors.gsOut(), fDevCoord.gsIn());
-    fnBody->appendf("%s = mat3(%s[(sk_InvocationID + 2) %% 3], "
-                              "%s[sk_InvocationID], "
-                              "%s[(sk_InvocationID + 1) %% 3]) * %s;",
+    fnBody->appendf("%s = float3x3(%s[(sk_InvocationID + 2) %% 3], "
+                                  "%s[sk_InvocationID], "
+                                  "%s[(sk_InvocationID + 1) %% 3]) * %s;",
                     fEdgeDistances.gsOut(), fEdgeDistance.gsIn(), fEdgeDistance.gsIn(),
                     fEdgeDistance.gsIn(), wind);
 
-    // Otherwise, fEdgeDistances = mat3(...) * sign(wind * rtAdjust.x * rdAdjust.z).
+    // Otherwise, fEdgeDistances = float3x3(...) * sign(wind * rtAdjust.x * rdAdjust.z).
     GR_STATIC_ASSERT(kTopLeft_GrSurfaceOrigin == GrCCPRCoverageProcessor::kAtlasOrigin);
 
     fnBody->appendf("%s = sk_InvocationID;", fCornerIdx.gsOut());
@@ -131,23 +133,23 @@
 void GrCCPRTriangleCornerProcessor::emitShaderCoverage(GrGLSLFragmentBuilder* f,
                                                        const char* outputCoverage) const {
     // FIXME: Adreno breaks if we don't put the frag coord in an intermediate highp variable.
-    f->codeAppendf("highp vec2 fragcoord = sk_FragCoord.xy;");
+    f->codeAppendf("highp float2 fragcoord = sk_FragCoord.xy;");
 
     // Approximate coverage by tracking where 4 horizontal lines enter and leave the triangle.
     GrShaderVar samples("samples", kVec4f_GrSLType, GrShaderVar::kNonArray,
                         kHigh_GrSLPrecision);
     f->declareGlobal(samples);
-    f->codeAppendf("%s = fragcoord.y + vec4(-0.375, -0.125, 0.125, 0.375);", samples.c_str());
+    f->codeAppendf("%s = fragcoord.y + float4(-0.375, -0.125, 0.125, 0.375);", samples.c_str());
 
     GrShaderVar leftedge("leftedge", kVec4f_GrSLType, GrShaderVar::kNonArray,
                          kHigh_GrSLPrecision);
     f->declareGlobal(leftedge);
-    f->codeAppendf("%s = vec4(fragcoord.x - 0.5);", leftedge.c_str());
+    f->codeAppendf("%s = float4(fragcoord.x - 0.5);", leftedge.c_str());
 
     GrShaderVar rightedge("rightedge", kVec4f_GrSLType, GrShaderVar::kNonArray,
                           kHigh_GrSLPrecision);
     f->declareGlobal(rightedge);
-    f->codeAppendf("%s = vec4(fragcoord.x + 0.5);", rightedge.c_str());
+    f->codeAppendf("%s = float4(fragcoord.x + 0.5);", rightedge.c_str());
 
     SkString sampleEdgeFn;
     GrShaderVar edgeArg("edge_distance", kVec3f_GrSLType, GrShaderVar::kNonArray,
@@ -156,7 +158,7 @@
         SkString b;
         b.appendf("highp float m = abs(%s.x) < 1e-3 ? 1e18 : -1 / %s.x;",
                   edgeArg.c_str(), edgeArg.c_str());
-        b.appendf("highp vec4 edge = m * (%s.y * samples + %s.z);",
+        b.appendf("highp float4 edge = m * (%s.y * samples + %s.z);",
                   edgeArg.c_str(), edgeArg.c_str());
         b.appendf("if (%s.x <= 1e-3 || (abs(%s.x) < 1e-3 && %s.y > 0)) {",
                   edgeArg.c_str(), edgeArg.c_str(), edgeArg.c_str());
@@ -168,10 +170,10 @@
     }().c_str(), &sampleEdgeFn);
 
     // See if the previous neighbor already handled this pixel.
-    f->codeAppendf("if (all(lessThan(abs(fragcoord - %s.zw), vec2(%f)))) {",
+    f->codeAppendf("if (all(lessThan(abs(fragcoord - %s.zw), float2(%f)))) {",
                    fNeighbors.fsIn(), kAABloatRadius);
     // Handle the case where all 3 corners defer to the previous neighbor.
-    f->codeAppendf(    "if (%s != 0 || !all(lessThan(abs(fragcoord - %s.xy), vec2(%f)))) {",
+    f->codeAppendf(    "if (%s != 0 || !all(lessThan(abs(fragcoord - %s.xy), float2(%f)))) {",
                        fCornerIdx.fsIn(), fNeighbors.fsIn(), kAABloatRadius);
     f->codeAppend (        "discard;");
     f->codeAppend (    "}");
@@ -179,7 +181,7 @@
 
     // Erase what the hull and two edges wrote at this corner in previous shaders (the two .5's
     // for the edges and the -1 for the hull cancel each other out).
-    f->codeAppendf("%s = dot(vec3(fragcoord, 1) * mat2x3(%s), vec2(1));",
+    f->codeAppendf("%s = dot(float3(fragcoord, 1) * float2x3(%s), float2(1));",
                    outputCoverage, fEdgeDistances.fsIn());
 
     // Sample the two edges at this corner.
@@ -187,15 +189,15 @@
     f->codeAppendf("%s(%s[1]);", sampleEdgeFn.c_str(), fEdgeDistances.fsIn());
 
     // Handle the opposite edge if the next neighbor will defer to us.
-    f->codeAppendf("if (all(lessThan(abs(fragcoord - %s.xy), vec2(%f)))) {",
+    f->codeAppendf("if (all(lessThan(abs(fragcoord - %s.xy), float2(%f)))) {",
                    fNeighbors.fsIn(), kAABloatRadius);
     // Erase the coverage the opposite edge wrote to this corner.
-    f->codeAppendf(    "%s += dot(%s[2], vec3(fragcoord, 1)) + 0.5;",
+    f->codeAppendf(    "%s += dot(%s[2], float3(fragcoord, 1)) + 0.5;",
                        outputCoverage, fEdgeDistances.fsIn());
     // Sample the opposite edge.
     f->codeAppendf(    "%s(%s[2]);", sampleEdgeFn.c_str(), fEdgeDistances.fsIn());
     f->codeAppend ("}");
 
-    f->codeAppendf("highp vec4 widths = max(%s - %s, 0);", rightedge.c_str(), leftedge.c_str());
-    f->codeAppendf("%s += dot(widths, vec4(0.25));", outputCoverage);
+    f->codeAppendf("highp float4 widths = max(%s - %s, 0);", rightedge.c_str(), leftedge.c_str());
+    f->codeAppendf("%s += dot(widths, float4(0.25));", outputCoverage);
 }