diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-09-18 02:41:08 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-09-18 03:01:47 +0000 |
commit | 27185a9b9756d2f5fcc077c6c2c005259d4ba517 (patch) | |
tree | 7b1747160cb0fb3fb69ecd61de24f4310ee8cf7b /src/gpu/ops | |
parent | 56fbbd65807d1c4ff63b5233764c6e15cba51bb4 (diff) |
Revert "Revert "Revert "Switched highp float to highfloat and mediump float to half."""
This reverts commit 05d5a13fea6246648de7e41358ed338d53c85ea2.
Reason for revert: looks like it broke filterfastbounds
Original change's description:
> Revert "Revert "Switched highp float to highfloat and mediump float to half.""
>
> This reverts commit 1d816b92bb7cf2258007f3f74ffd143b89f25d01.
>
> Bug: skia:
> Change-Id: I388b5e5e9bf619db48297a80c9a80c039f26c9f1
> Reviewed-on: https://skia-review.googlesource.com/46464
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
TBR=bsalomon@google.com,ethannicholas@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Iddf6aef2ab084aa73da7ceebdfc303a1d2b80cde
Reviewed-on: https://skia-review.googlesource.com/47441
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/ops')
-rw-r--r-- | src/gpu/ops/GrAAConvexPathRenderer.cpp | 12 | ||||
-rw-r--r-- | src/gpu/ops/GrDashOp.cpp | 40 | ||||
-rw-r--r-- | src/gpu/ops/GrMSAAPathRenderer.cpp | 4 | ||||
-rw-r--r-- | src/gpu/ops/GrOvalOpFactory.cpp | 70 | ||||
-rw-r--r-- | src/gpu/ops/GrTextureOp.cpp | 8 |
5 files changed, 67 insertions, 67 deletions
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp index 50077a89b6..91b54c8d01 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 76f1ff4981..640e8a9f7b 100644 --- a/src/gpu/ops/GrDashOp.cpp +++ b/src/gpu/ops/GrDashOp.cpp @@ -887,12 +887,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); @@ -913,21 +913,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, @@ -1090,13 +1090,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); @@ -1117,14 +1117,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()); @@ -1132,24 +1132,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 45fe9f3009..3fb1acdfa2 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 5580e52475..243e38b79a 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, diff --git a/src/gpu/ops/GrTextureOp.cpp b/src/gpu/ops/GrTextureOp.cpp index 732b9c9e84..e03d98a309 100644 --- a/src/gpu/ops/GrTextureOp.cpp +++ b/src/gpu/ops/GrTextureOp.cpp @@ -115,7 +115,7 @@ public: args.fVaryingHandler->addPassThroughAttribute(&textureGP.fColors, args.fOutputColor); } - args.fFragBuilder->codeAppend("highfloat2 texCoord;"); + args.fFragBuilder->codeAppend("highp float2 texCoord;"); args.fVaryingHandler->addPassThroughAttribute(&textureGP.fTextureCoords, "texCoord", kHigh_GrSLPrecision); if (textureGP.numTextureSamplers() > 1) { @@ -134,7 +134,7 @@ public: args.fFragBuilder->appendTextureLookupAndModulate(args.fOutputColor, args.fTexSamplers[i], "texCoord", - kHighFloat2_GrSLType, + kVec2f_GrSLType, &fColorSpaceXformHelper); args.fFragBuilder->codeAppend("; break;"); } @@ -144,11 +144,11 @@ public: args.fFragBuilder->appendTextureLookupAndModulate(args.fOutputColor, args.fTexSamplers[0], "texCoord", - kHighFloat2_GrSLType, + kVec2f_GrSLType, &fColorSpaceXformHelper); } args.fFragBuilder->codeAppend(";"); - args.fFragBuilder->codeAppendf("%s = highfloat4(1);", args.fOutputCoverage); + args.fFragBuilder->codeAppendf("%s = float4(1);", args.fOutputCoverage); } GrGLSLColorSpaceXformHelper fColorSpaceXformHelper; }; |