| Index: src/gpu/effects/GrDitherEffect.cpp
|
| diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
|
| index e6f3fbe5cf0bca765be853961b2e36c42f9ddd3a..37cc1ae5701eb7f6a663e97393690d8370df4db1 100644
|
| --- a/src/gpu/effects/GrDitherEffect.cpp
|
| +++ b/src/gpu/effects/GrDitherEffect.cpp
|
| @@ -73,7 +73,7 @@ GLDitherEffect::GLDitherEffect(const GrProcessor&) {
|
| }
|
|
|
| void GLDitherEffect::emitCode(EmitArgs& args) {
|
| - GrGLSLFragmentBuilder* fsBuilder = args.fBuilder->getFragmentShaderBuilder();
|
| + GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
|
| // Generate a random number based on the fragment position. For this
|
| // random number generator, we use the "GLSL rand" function
|
| // that seems to be floating around on the internet. It works under
|
| @@ -83,11 +83,11 @@ 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.
|
| - fsBuilder->codeAppendf("\t\tfloat r = "
|
| - "fract(sin(dot(%s.xy ,vec2(12.9898,78.233))) * 43758.5453);\n",
|
| - fsBuilder->fragmentPosition());
|
| - fsBuilder->codeAppendf("\t\t%s = (1.0/255.0) * vec4(r, r, r, r) + %s;\n",
|
| - args.fOutputColor, GrGLSLExpr4(args.fInputColor).c_str());
|
| + fragBuilder->codeAppendf("\t\tfloat r = "
|
| + "fract(sin(dot(%s.xy ,vec2(12.9898,78.233))) * 43758.5453);\n",
|
| + fragBuilder->fragmentPosition());
|
| + fragBuilder->codeAppendf("\t\t%s = (1.0/255.0) * vec4(r, r, r, r) + %s;\n",
|
| + args.fOutputColor, GrGLSLExpr4(args.fInputColor).c_str());
|
| }
|
|
|
| //////////////////////////////////////////////////////////////////////////////
|
|
|