aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrDitherEffect.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-01-19 16:58:02 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-19 22:36:26 +0000
commitde4d301881e7fd084f1f0b359ec6f9b2bf8bd4c5 (patch)
treeedbe55dab521fec2922e3826b4e3d26150254411 /src/gpu/effects/GrDitherEffect.cpp
parent5bee0b6de6b3ad1166d067e6b5046b48b8240a29 (diff)
Replaced all calls to fragmentPosition() with sk_FragCoord
BUG=skia: Change-Id: I179576e148ea6caf6e1c40f0a216421898bcb35d Reviewed-on: https://skia-review.googlesource.com/5941 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrDitherEffect.cpp')
-rw-r--r--src/gpu/effects/GrDitherEffect.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index eb7fe6280a..a93e74f412 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -28,7 +28,6 @@ public:
private:
DitherEffect() {
this->initClassID<DitherEffect>();
- this->setWillReadFragmentPosition();
}
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
@@ -79,8 +78,8 @@ void GLDitherEffect::emitCode(EmitArgs& args) {
// For each channel c, add the random offset to the pixel to either bump
// it up or let it remain constant during quantization.
fragBuilder->codeAppendf("\t\tfloat r = "
- "fract(sin(dot(%s.xy ,vec2(12.9898,78.233))) * 43758.5453);\n",
- fragBuilder->fragmentPosition());
+ "fract(sin(dot(sk_FragCoord.xy, vec2(12.9898,78.233))) * "
+ "43758.5453);\n");
fragBuilder->codeAppendf("\t\t%s = (1.0/255.0) * vec4(r, r, r, r) + %s;\n",
args.fOutputColor, GrGLSLExpr4(args.fInputColor).c_str());
}