aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/GrAlphaThresholdFragmentProcessor.fp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-09-15 11:42:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-09-15 18:50:54 +0000
commit05d5a13fea6246648de7e41358ed338d53c85ea2 (patch)
tree695fdbeae1116f8ce813288e47b31c2a99f28f1f /src/effects/GrAlphaThresholdFragmentProcessor.fp
parent49f1f34438d3431f6d7e32847accd2ba96948a73 (diff)
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>
Diffstat (limited to 'src/effects/GrAlphaThresholdFragmentProcessor.fp')
-rw-r--r--src/effects/GrAlphaThresholdFragmentProcessor.fp12
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;
}