diff options
author | 2017-08-16 16:41:30 -0400 | |
---|---|---|
committer | 2017-08-16 23:05:15 +0000 | |
commit | 88d99c63878c2d3d340120f0321676f72afcb4f0 (patch) | |
tree | 5b957dbf2f78ef7a15aa3810f8922c915508683f /src/effects/GrAlphaThresholdFragmentProcessor.fp | |
parent | a26d219a929f4e70f8597dfd57a53348c4bba905 (diff) |
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>
Diffstat (limited to 'src/effects/GrAlphaThresholdFragmentProcessor.fp')
-rw-r--r-- | src/effects/GrAlphaThresholdFragmentProcessor.fp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.fp b/src/effects/GrAlphaThresholdFragmentProcessor.fp index 481549e6b5..c3b3fbf5d5 100644 --- a/src/effects/GrAlphaThresholdFragmentProcessor.fp +++ b/src/effects/GrAlphaThresholdFragmentProcessor.fp @@ -1,8 +1,8 @@ in uniform sampler2D image; in uniform colorSpaceXform colorXform; in uniform sampler2D mask; -in uniform float innerThreshold; -in uniform float outerThreshold; +in uniform half innerThreshold; +in uniform half outerThreshold; @class { inline OptimizationFlags optFlags(float outerThreshold); @@ -49,16 +49,16 @@ in uniform float outerThreshold; } void main() { - float4 color = texture(image, sk_TransformedCoords2D[0], colorXform); - float4 mask_color = texture(mask, sk_TransformedCoords2D[1]); + half4 color = texture(image, sk_TransformedCoords2D[0], colorXform); + half4 mask_color = texture(mask, sk_TransformedCoords2D[1]); if (mask_color.a < 0.5) { if (color.a > outerThreshold) { - float scale = outerThreshold / color.a; + half scale = outerThreshold / color.a; color.rgb *= scale; color.a = outerThreshold; } } else if (color.a < innerThreshold) { - float scale = innerThreshold / max(0.001, color.a); + half scale = innerThreshold / max(0.001, color.a); color.rgb *= scale; color.a = innerThreshold; } |