Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: src/gpu/effects/GrDitherEffect.cpp

Issue 354663002: Make GrGLShaderBuilder::fragmentPosition() return a vec4, with 1.0 as the zw components when in the… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: line wraps Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDitherEffect.cpp
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index e82b565b5ecc1a7bf23aa3c8bafbef41b8393540..7409e5ff7151818442b74ed68938d27ec38cd9b0 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -102,7 +102,7 @@ void GLDitherEffect::emitCode(GrGLShaderBuilder* builder,
// For each channel c, add the random offset to the pixel to either bump
// it up or let it remain constant during quantization.
builder->fsCodeAppendf("\t\tfloat r = "
- "fract(sin(dot(%s ,vec2(12.9898,78.233))) * 43758.5453);\n",
+ "fract(sin(dot(%s.xy ,vec2(12.9898,78.233))) * 43758.5453);\n",
builder->fragmentPosition());
builder->fsCodeAppendf("\t\t%s = (1.0/255.0) * vec4(r, r, r, r) + %s;\n",
outputColor, GrGLSLExpr4(inputColor).c_str());
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/effects/GrOvalEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698