diff options
author | 2017-09-18 14:10:39 -0400 | |
---|---|---|
committer | 2017-09-18 18:32:13 +0000 | |
commit | f7b8820dc813d1eb0b6b43fe4581dded0da38caf (patch) | |
tree | 518d313a9fa571a9f9ca26af7c381664694a4706 /src/effects/GrCircleBlurFragmentProcessor.fp | |
parent | 47a540f503bc722393b61c4b822e95b17f200125 (diff) |
re-land of new SkSL precisions
Bug: skia:
Change-Id: Ic1deb3db2cbda6ca45f93dee99832971a36a2119
Reviewed-on: https://skia-review.googlesource.com/47841
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/effects/GrCircleBlurFragmentProcessor.fp')
-rw-r--r-- | src/effects/GrCircleBlurFragmentProcessor.fp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/effects/GrCircleBlurFragmentProcessor.fp b/src/effects/GrCircleBlurFragmentProcessor.fp index 856a468b6c..d91bad8440 100644 --- a/src/effects/GrCircleBlurFragmentProcessor.fp +++ b/src/effects/GrCircleBlurFragmentProcessor.fp @@ -1,13 +1,13 @@ -in float4 circleRect; -in float textureRadius; -in float solidRadius; +in half4 circleRect; +in half textureRadius; +in half solidRadius; in uniform sampler2D blurProfileSampler; // The data is formatted as: // x, y - the center of the circle // z - inner radius that should map to 0th entry in the texture. // w - the inverse of the distance over which the texture is stretched. -uniform float4 circleData; +uniform half4 circleData; @optimizationFlags { kCompatibleWithCoverageAsAlpha_OptimizationFlag @@ -273,10 +273,10 @@ uniform float4 circleData; void main() { // We just want to compute "(length(vec) - circleData.z + 0.5) * circleData.w" but need to // rearrange for precision. - float2 vec = float2((sk_FragCoord.x - circleData.x) * circleData.w, - (sk_FragCoord.y - circleData.y) * circleData.w); - float dist = length(vec) + (0.5 - circleData.z) * circleData.w; - sk_OutColor = sk_InColor * texture(blurProfileSampler, float2(dist, 0.5)).a; + half2 vec = half2((sk_FragCoord.x - circleData.x) * circleData.w, + (sk_FragCoord.y - circleData.y) * circleData.w); + half dist = length(vec) + (0.5 - circleData.z) * circleData.w; + sk_OutColor = sk_InColor * texture(blurProfileSampler, half2(dist, 0.5)).a; } @test(testData) { |