aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ops
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-08-17 11:07:59 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-17 15:08:17 +0000
commit1d816b92bb7cf2258007f3f74ffd143b89f25d01 (patch)
tree07fb1e8e2631208eb007a4abdfe130db91e6cfc2 /src/gpu/ops
parent23f92277b916a4bdf11c320799ac9248af60a62e (diff)
Revert "Switched highp float to highfloat and mediump float to half."
This reverts commit 88d99c63878c2d3d340120f0321676f72afcb4f0. Reason for revert: Believed to be causing unit test failures in Chrome roll: https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/364433 https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Ftryserver.chromium.android%2Flinux_android_rel_ng%2F364433%2F%2B%2Frecipes%2Fsteps%2Fcontent_browsertests__with_patch__on_Android%2F0%2Flogs%2FWebRtcCaptureFromElementBrowserTest.VerifyCanvasWebGLCaptureColor%2F0 Original change's description: > Switched highp float to highfloat and mediump float to half. > > The ultimate goal is to end up with "float" and "half", but this > intermediate step uses "highfloat" so that it is clear if I missed a > "float" somewhere. Once this lands, a subsequent CL will switch all > "highfloats" back to "floats". > > Bug: skia: > Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca > Reviewed-on: https://skia-review.googlesource.com/31000 > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com Change-Id: I8bfa97547ac3920d433665f161d27df3f15c83aa No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/35705 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/ops')
-rw-r--r--src/gpu/ops/GrAAConvexPathRenderer.cpp12
-rw-r--r--src/gpu/ops/GrDashOp.cpp40
-rw-r--r--src/gpu/ops/GrMSAAPathRenderer.cpp4
-rw-r--r--src/gpu/ops/GrOvalOpFactory.cpp70
4 files changed, 63 insertions, 63 deletions
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index 66cf3ffb15..425dbae148 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -564,7 +564,7 @@ public:
// emit attributes
varyingHandler->emitAttributes(qe);
- GrGLSLVertToFrag v(kHalf4_GrSLType);
+ GrGLSLVertToFrag v(kVec4f_GrSLType);
varyingHandler->addVarying("QuadEdge", &v);
vertBuilder->codeAppendf("%s = %s;", v.vsOut(), qe.fInQuadEdge->fName);
@@ -585,17 +585,17 @@ public:
qe.fLocalMatrix,
args.fFPCoordTransformHandler);
- fragBuilder->codeAppendf("half edgeAlpha;");
+ fragBuilder->codeAppendf("float edgeAlpha;");
// keep the derivative instructions outside the conditional
- fragBuilder->codeAppendf("half2 duvdx = dFdx(%s.xy);", v.fsIn());
- fragBuilder->codeAppendf("half2 duvdy = dFdy(%s.xy);", v.fsIn());
+ fragBuilder->codeAppendf("float2 duvdx = dFdx(%s.xy);", v.fsIn());
+ fragBuilder->codeAppendf("float2 duvdy = dFdy(%s.xy);", v.fsIn());
fragBuilder->codeAppendf("if (%s.z > 0.0 && %s.w > 0.0) {", v.fsIn(), v.fsIn());
// today we know z and w are in device space. We could use derivatives
fragBuilder->codeAppendf("edgeAlpha = min(min(%s.z, %s.w) + 0.5, 1.0);", v.fsIn(),
v.fsIn());
fragBuilder->codeAppendf ("} else {");
- fragBuilder->codeAppendf("half2 gF = half2(2.0*%s.x*duvdx.x - duvdx.y,"
+ fragBuilder->codeAppendf("float2 gF = float2(2.0*%s.x*duvdx.x - duvdx.y,"
" 2.0*%s.x*duvdy.x - duvdy.y);",
v.fsIn(), v.fsIn());
fragBuilder->codeAppendf("edgeAlpha = (%s.x*%s.x - %s.y);", v.fsIn(), v.fsIn(),
@@ -603,7 +603,7 @@ public:
fragBuilder->codeAppendf("edgeAlpha = "
"clamp(0.5 - edgeAlpha / length(gF), 0.0, 1.0);}");
- fragBuilder->codeAppendf("%s = half4(edgeAlpha);", args.fOutputCoverage);
+ fragBuilder->codeAppendf("%s = float4(edgeAlpha);", args.fOutputCoverage);
}
static inline void GenKey(const GrGeometryProcessor& gp,
diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp
index 17ada15dee..14c15cb07a 100644
--- a/src/gpu/ops/GrDashOp.cpp
+++ b/src/gpu/ops/GrDashOp.cpp
@@ -882,12 +882,12 @@ void GLDashingCircleEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
varyingHandler->emitAttributes(dce);
// XY are dashPos, Z is dashInterval
- GrGLSLVertToFrag dashParams(kHalf3_GrSLType);
+ GrGLSLVertToFrag dashParams(kVec3f_GrSLType);
varyingHandler->addVarying("DashParam", &dashParams);
vertBuilder->codeAppendf("%s = %s;", dashParams.vsOut(), dce.inDashParams()->fName);
// x refers to circle radius - 0.5, y refers to cicle's center x coord
- GrGLSLVertToFrag circleParams(kHalf2_GrSLType);
+ GrGLSLVertToFrag circleParams(kVec2f_GrSLType);
varyingHandler->addVarying("CircleParams", &circleParams);
vertBuilder->codeAppendf("%s = %s;", circleParams.vsOut(), dce.inCircleParams()->fName);
@@ -908,21 +908,21 @@ void GLDashingCircleEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
args.fFPCoordTransformHandler);
// transforms all points so that we can compare them to our test circle
- fragBuilder->codeAppendf("half xShifted = %s.x - floor(%s.x / %s.z) * %s.z;",
+ fragBuilder->codeAppendf("float xShifted = %s.x - floor(%s.x / %s.z) * %s.z;",
dashParams.fsIn(), dashParams.fsIn(), dashParams.fsIn(),
dashParams.fsIn());
- fragBuilder->codeAppendf("half2 fragPosShifted = half2(xShifted, %s.y);", dashParams.fsIn());
- fragBuilder->codeAppendf("half2 center = half2(%s.y, 0.0);", circleParams.fsIn());
- fragBuilder->codeAppend("half dist = length(center - fragPosShifted);");
+ fragBuilder->codeAppendf("float2 fragPosShifted = float2(xShifted, %s.y);", dashParams.fsIn());
+ fragBuilder->codeAppendf("float2 center = float2(%s.y, 0.0);", circleParams.fsIn());
+ fragBuilder->codeAppend("float dist = length(center - fragPosShifted);");
if (dce.aaMode() != AAMode::kNone) {
- fragBuilder->codeAppendf("half diff = dist - %s.x;", circleParams.fsIn());
+ fragBuilder->codeAppendf("float diff = dist - %s.x;", circleParams.fsIn());
fragBuilder->codeAppend("diff = 1.0 - diff;");
- fragBuilder->codeAppend("half alpha = clamp(diff, 0.0, 1.0);");
+ fragBuilder->codeAppend("float alpha = clamp(diff, 0.0, 1.0);");
} else {
- fragBuilder->codeAppendf("half alpha = 1.0;");
+ fragBuilder->codeAppendf("float alpha = 1.0;");
fragBuilder->codeAppendf("alpha *= dist < %s.x + 0.5 ? 1.0 : 0.0;", circleParams.fsIn());
}
- fragBuilder->codeAppendf("%s = half4(alpha);", args.fOutputCoverage);
+ fragBuilder->codeAppendf("%s = float4(alpha);", args.fOutputCoverage);
}
void GLDashingCircleEffect::setData(const GrGLSLProgramDataManager& pdman,
@@ -1085,13 +1085,13 @@ void GLDashingLineEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
varyingHandler->emitAttributes(de);
// XY refers to dashPos, Z is the dash interval length
- GrGLSLVertToFrag inDashParams(kHighFloat3_GrSLType);
+ GrGLSLVertToFrag inDashParams(kVec3f_GrSLType);
varyingHandler->addVarying("DashParams", &inDashParams, GrSLPrecision::kHigh_GrSLPrecision);
vertBuilder->codeAppendf("%s = %s;", inDashParams.vsOut(), de.inDashParams()->fName);
// The rect uniform's xyzw refer to (left + 0.5, top + 0.5, right - 0.5, bottom - 0.5),
// respectively.
- GrGLSLVertToFrag inRectParams(kHighFloat4_GrSLType);
+ GrGLSLVertToFrag inRectParams(kVec4f_GrSLType);
varyingHandler->addVarying("RectParams", &inRectParams, GrSLPrecision::kHigh_GrSLPrecision);
vertBuilder->codeAppendf("%s = %s;", inRectParams.vsOut(), de.inRectParams()->fName);
@@ -1112,14 +1112,14 @@ void GLDashingLineEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
args.fFPCoordTransformHandler);
// transforms all points so that we can compare them to our test rect
- fragBuilder->codeAppendf("half xShifted = %s.x - floor(%s.x / %s.z) * %s.z;",
+ fragBuilder->codeAppendf("float xShifted = %s.x - floor(%s.x / %s.z) * %s.z;",
inDashParams.fsIn(), inDashParams.fsIn(), inDashParams.fsIn(),
inDashParams.fsIn());
- fragBuilder->codeAppendf("half2 fragPosShifted = half2(xShifted, %s.y);", inDashParams.fsIn());
+ fragBuilder->codeAppendf("float2 fragPosShifted = float2(xShifted, %s.y);", inDashParams.fsIn());
if (de.aaMode() == AAMode::kCoverage) {
// The amount of coverage removed in x and y by the edges is computed as a pair of negative
// numbers, xSub and ySub.
- fragBuilder->codeAppend("half xSub, ySub;");
+ fragBuilder->codeAppend("float xSub, ySub;");
fragBuilder->codeAppendf("xSub = min(fragPosShifted.x - %s.x, 0.0);", inRectParams.fsIn());
fragBuilder->codeAppendf("xSub += min(%s.z - fragPosShifted.x, 0.0);", inRectParams.fsIn());
fragBuilder->codeAppendf("ySub = min(fragPosShifted.y - %s.y, 0.0);", inRectParams.fsIn());
@@ -1127,24 +1127,24 @@ void GLDashingLineEffect::onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) {
// Now compute coverage in x and y and multiply them to get the fraction of the pixel
// covered.
fragBuilder->codeAppendf(
- "half alpha = (1.0 + max(xSub, -1.0)) * (1.0 + max(ySub, -1.0));");
+ "float alpha = (1.0 + max(xSub, -1.0)) * (1.0 + max(ySub, -1.0));");
} else if (de.aaMode() == AAMode::kCoverageWithMSAA) {
// For MSAA, we don't modulate the alpha by the Y distance, since MSAA coverage will handle
// AA on the the top and bottom edges. The shader is only responsible for intra-dash alpha.
- fragBuilder->codeAppend("half xSub;");
+ fragBuilder->codeAppend("float xSub;");
fragBuilder->codeAppendf("xSub = min(fragPosShifted.x - %s.x, 0.0);", inRectParams.fsIn());
fragBuilder->codeAppendf("xSub += min(%s.z - fragPosShifted.x, 0.0);", inRectParams.fsIn());
// Now compute coverage in x to get the fraction of the pixel covered.
- fragBuilder->codeAppendf("half alpha = (1.0 + max(xSub, -1.0));");
+ fragBuilder->codeAppendf("float alpha = (1.0 + max(xSub, -1.0));");
} else {
// Assuming the bounding geometry is tight so no need to check y values
- fragBuilder->codeAppendf("half alpha = 1.0;");
+ fragBuilder->codeAppendf("float alpha = 1.0;");
fragBuilder->codeAppendf("alpha *= (fragPosShifted.x - %s.x) > -0.5 ? 1.0 : 0.0;",
inRectParams.fsIn());
fragBuilder->codeAppendf("alpha *= (%s.z - fragPosShifted.x) >= -0.5 ? 1.0 : 0.0;",
inRectParams.fsIn());
}
- fragBuilder->codeAppendf("%s = half4(alpha);", args.fOutputCoverage);
+ fragBuilder->codeAppendf("%s = float4(alpha);", args.fOutputCoverage);
}
void GLDashingLineEffect::setData(const GrGLSLProgramDataManager& pdman,
diff --git a/src/gpu/ops/GrMSAAPathRenderer.cpp b/src/gpu/ops/GrMSAAPathRenderer.cpp
index 16ff097642..ef19367f61 100644
--- a/src/gpu/ops/GrMSAAPathRenderer.cpp
+++ b/src/gpu/ops/GrMSAAPathRenderer.cpp
@@ -140,7 +140,7 @@ public:
varyingHandler->emitAttributes(qp);
varyingHandler->addPassThroughAttribute(qp.inColor(), args.fOutputColor);
- GrGLSLVertToFrag uv(kHighFloat2_GrSLType);
+ GrGLSLVertToFrag uv(kVec2f_GrSLType);
varyingHandler->addVarying("uv", &uv, kHigh_GrSLPrecision);
vsBuilder->codeAppendf("%s = %s;", uv.vsOut(), qp.inUV()->fName);
@@ -156,7 +156,7 @@ public:
GrGLSLPPFragmentBuilder* fsBuilder = args.fFragBuilder;
fsBuilder->codeAppendf("if (%s.x * %s.x >= %s.y) discard;", uv.fsIn(), uv.fsIn(),
uv.fsIn());
- fsBuilder->codeAppendf("%s = half4(1.0);", args.fOutputCoverage);
+ fsBuilder->codeAppendf("%s = float4(1.0);", args.fOutputCoverage);
}
static inline void GenKey(const GrGeometryProcessor& gp,
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index 363c73f15b..5677bcee30 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -119,21 +119,21 @@ private:
// emit attributes
varyingHandler->emitAttributes(cgp);
- fragBuilder->codeAppend("highfloat4 circleEdge;");
+ fragBuilder->codeAppend("highp float4 circleEdge;");
varyingHandler->addPassThroughAttribute(cgp.fInCircleEdge, "circleEdge",
kHigh_GrSLPrecision);
if (cgp.fInClipPlane) {
- fragBuilder->codeAppend("half3 clipPlane;");
+ fragBuilder->codeAppend("float3 clipPlane;");
varyingHandler->addPassThroughAttribute(cgp.fInClipPlane, "clipPlane");
}
if (cgp.fInIsectPlane) {
SkASSERT(cgp.fInClipPlane);
- fragBuilder->codeAppend("half3 isectPlane;");
+ fragBuilder->codeAppend("float3 isectPlane;");
varyingHandler->addPassThroughAttribute(cgp.fInIsectPlane, "isectPlane");
}
if (cgp.fInUnionPlane) {
SkASSERT(cgp.fInClipPlane);
- fragBuilder->codeAppend("half3 unionPlane;");
+ fragBuilder->codeAppend("float3 unionPlane;");
varyingHandler->addPassThroughAttribute(cgp.fInUnionPlane, "unionPlane");
}
@@ -152,19 +152,19 @@ private:
cgp.fLocalMatrix,
args.fFPCoordTransformHandler);
- fragBuilder->codeAppend("highfloat d = length(circleEdge.xy);");
- fragBuilder->codeAppend("half distanceToOuterEdge = circleEdge.z * (1.0 - d);");
- fragBuilder->codeAppend("half edgeAlpha = clamp(distanceToOuterEdge, 0.0, 1.0);");
+ fragBuilder->codeAppend("highp float d = length(circleEdge.xy);");
+ fragBuilder->codeAppend("float distanceToOuterEdge = circleEdge.z * (1.0 - d);");
+ fragBuilder->codeAppend("float edgeAlpha = clamp(distanceToOuterEdge, 0.0, 1.0);");
if (cgp.fStroke) {
fragBuilder->codeAppend(
- "half distanceToInnerEdge = circleEdge.z * (d - circleEdge.w);");
- fragBuilder->codeAppend("half innerAlpha = clamp(distanceToInnerEdge, 0.0, 1.0);");
+ "float distanceToInnerEdge = circleEdge.z * (d - circleEdge.w);");
+ fragBuilder->codeAppend("float innerAlpha = clamp(distanceToInnerEdge, 0.0, 1.0);");
fragBuilder->codeAppend("edgeAlpha *= innerAlpha;");
}
if (cgp.fInClipPlane) {
fragBuilder->codeAppend(
- "half clip = clamp(circleEdge.z * dot(circleEdge.xy, clipPlane.xy) + "
+ "float clip = clamp(circleEdge.z * dot(circleEdge.xy, clipPlane.xy) + "
"clipPlane.z, 0.0, 1.0);");
if (cgp.fInIsectPlane) {
fragBuilder->codeAppend(
@@ -178,7 +178,7 @@ private:
}
fragBuilder->codeAppend("edgeAlpha *= clip;");
}
- fragBuilder->codeAppendf("%s = half4(edgeAlpha);", args.fOutputCoverage);
+ fragBuilder->codeAppendf("%s = float4(edgeAlpha);", args.fOutputCoverage);
}
static void GenKey(const GrGeometryProcessor& gp,
@@ -275,12 +275,12 @@ private:
// emit attributes
varyingHandler->emitAttributes(egp);
- GrGLSLVertToFrag ellipseOffsets(kHalf2_GrSLType);
+ GrGLSLVertToFrag ellipseOffsets(kVec2f_GrSLType);
varyingHandler->addVarying("EllipseOffsets", &ellipseOffsets);
vertBuilder->codeAppendf("%s = %s;", ellipseOffsets.vsOut(),
egp.fInEllipseOffset->fName);
- GrGLSLVertToFrag ellipseRadii(kHalf4_GrSLType);
+ GrGLSLVertToFrag ellipseRadii(kVec4f_GrSLType);
varyingHandler->addVarying("EllipseRadii", &ellipseRadii);
vertBuilder->codeAppendf("%s = %s;", ellipseRadii.vsOut(), egp.fInEllipseRadii->fName);
@@ -301,16 +301,16 @@ private:
args.fFPCoordTransformHandler);
// for outer curve
- fragBuilder->codeAppendf("half2 scaledOffset = %s*%s.xy;", ellipseOffsets.fsIn(),
+ fragBuilder->codeAppendf("float2 scaledOffset = %s*%s.xy;", ellipseOffsets.fsIn(),
ellipseRadii.fsIn());
- fragBuilder->codeAppend("half test = dot(scaledOffset, scaledOffset) - 1.0;");
- fragBuilder->codeAppendf("half2 grad = 2.0*scaledOffset*%s.xy;", ellipseRadii.fsIn());
- fragBuilder->codeAppend("half grad_dot = dot(grad, grad);");
+ fragBuilder->codeAppend("float test = dot(scaledOffset, scaledOffset) - 1.0;");
+ fragBuilder->codeAppendf("float2 grad = 2.0*scaledOffset*%s.xy;", ellipseRadii.fsIn());
+ fragBuilder->codeAppend("float grad_dot = dot(grad, grad);");
// avoid calling inversesqrt on zero.
fragBuilder->codeAppend("grad_dot = max(grad_dot, 1.0e-4);");
- fragBuilder->codeAppend("half invlen = inversesqrt(grad_dot);");
- fragBuilder->codeAppend("half edgeAlpha = clamp(0.5-test*invlen, 0.0, 1.0);");
+ fragBuilder->codeAppend("float invlen = inversesqrt(grad_dot);");
+ fragBuilder->codeAppend("float edgeAlpha = clamp(0.5-test*invlen, 0.0, 1.0);");
// for inner curve
if (egp.fStroke) {
@@ -322,7 +322,7 @@ private:
fragBuilder->codeAppend("edgeAlpha *= clamp(0.5+test*invlen, 0.0, 1.0);");
}
- fragBuilder->codeAppendf("%s = half4(edgeAlpha);", args.fOutputCoverage);
+ fragBuilder->codeAppendf("%s = float4(edgeAlpha);", args.fOutputCoverage);
}
static void GenKey(const GrGeometryProcessor& gp,
@@ -417,11 +417,11 @@ private:
// emit attributes
varyingHandler->emitAttributes(diegp);
- GrGLSLVertToFrag offsets0(kHalf2_GrSLType);
+ GrGLSLVertToFrag offsets0(kVec2f_GrSLType);
varyingHandler->addVarying("EllipseOffsets0", &offsets0);
vertBuilder->codeAppendf("%s = %s;", offsets0.vsOut(), diegp.fInEllipseOffsets0->fName);
- GrGLSLVertToFrag offsets1(kHalf2_GrSLType);
+ GrGLSLVertToFrag offsets1(kVec2f_GrSLType);
varyingHandler->addVarying("EllipseOffsets1", &offsets1);
vertBuilder->codeAppendf("%s = %s;", offsets1.vsOut(), diegp.fInEllipseOffsets1->fName);
@@ -445,25 +445,25 @@ private:
args.fFPCoordTransformHandler);
// for outer curve
- fragBuilder->codeAppendf("half2 scaledOffset = %s.xy;", offsets0.fsIn());
- fragBuilder->codeAppend("half test = dot(scaledOffset, scaledOffset) - 1.0;");
- fragBuilder->codeAppendf("half2 duvdx = dFdx(%s);", offsets0.fsIn());
- fragBuilder->codeAppendf("half2 duvdy = dFdy(%s);", offsets0.fsIn());
+ fragBuilder->codeAppendf("float2 scaledOffset = %s.xy;", offsets0.fsIn());
+ fragBuilder->codeAppend("float test = dot(scaledOffset, scaledOffset) - 1.0;");
+ fragBuilder->codeAppendf("float2 duvdx = dFdx(%s);", offsets0.fsIn());
+ fragBuilder->codeAppendf("float2 duvdy = dFdy(%s);", offsets0.fsIn());
fragBuilder->codeAppendf(
- "half2 grad = half2(2.0*%s.x*duvdx.x + 2.0*%s.y*duvdx.y,"
- " 2.0*%s.x*duvdy.x + 2.0*%s.y*duvdy.y);",
+ "float2 grad = float2(2.0*%s.x*duvdx.x + 2.0*%s.y*duvdx.y,"
+ " 2.0*%s.x*duvdy.x + 2.0*%s.y*duvdy.y);",
offsets0.fsIn(), offsets0.fsIn(), offsets0.fsIn(), offsets0.fsIn());
- fragBuilder->codeAppend("half grad_dot = dot(grad, grad);");
+ fragBuilder->codeAppend("float grad_dot = dot(grad, grad);");
// avoid calling inversesqrt on zero.
fragBuilder->codeAppend("grad_dot = max(grad_dot, 1.0e-4);");
- fragBuilder->codeAppend("half invlen = inversesqrt(grad_dot);");
+ fragBuilder->codeAppend("float invlen = inversesqrt(grad_dot);");
if (DIEllipseStyle::kHairline == diegp.fStyle) {
// can probably do this with one step
- fragBuilder->codeAppend("half edgeAlpha = clamp(1.0-test*invlen, 0.0, 1.0);");
+ fragBuilder->codeAppend("float edgeAlpha = clamp(1.0-test*invlen, 0.0, 1.0);");
fragBuilder->codeAppend("edgeAlpha *= clamp(1.0+test*invlen, 0.0, 1.0);");
} else {
- fragBuilder->codeAppend("half edgeAlpha = clamp(0.5-test*invlen, 0.0, 1.0);");
+ fragBuilder->codeAppend("float edgeAlpha = clamp(0.5-test*invlen, 0.0, 1.0);");
}
// for inner curve
@@ -473,14 +473,14 @@ private:
fragBuilder->codeAppendf("duvdx = dFdx(%s);", offsets1.fsIn());
fragBuilder->codeAppendf("duvdy = dFdy(%s);", offsets1.fsIn());
fragBuilder->codeAppendf(
- "grad = half2(2.0*%s.x*duvdx.x + 2.0*%s.y*duvdx.y,"
- " 2.0*%s.x*duvdy.x + 2.0*%s.y*duvdy.y);",
+ "grad = float2(2.0*%s.x*duvdx.x + 2.0*%s.y*duvdx.y,"
+ " 2.0*%s.x*duvdy.x + 2.0*%s.y*duvdy.y);",
offsets1.fsIn(), offsets1.fsIn(), offsets1.fsIn(), offsets1.fsIn());
fragBuilder->codeAppend("invlen = inversesqrt(dot(grad, grad));");
fragBuilder->codeAppend("edgeAlpha *= clamp(0.5+test*invlen, 0.0, 1.0);");
}
- fragBuilder->codeAppendf("%s = half4(edgeAlpha);", args.fOutputCoverage);
+ fragBuilder->codeAppendf("%s = float4(edgeAlpha);", args.fOutputCoverage);
}
static void GenKey(const GrGeometryProcessor& gp,