Improve inputColor handling in fragment processor implementations.
EmitArgs explicitly checks for null constructor arguments and uses
"half4(1)" for fInputColor to ensure its fields are non-null.
Cleans up accesses of fInputColor in existing fragment processors to no
longer check for null and hardcode a "half4(1)".
Updates .fp CPP generation to remove the null check for fInputArgs.
Updates the internals of emitChild() to emit an extra local variable
with a mangled variable name for storing the provided input expression.
Bug: skia:
Change-Id: Iad807f269655689dcb2e8d58f2eb506685ba2757
Reviewed-on: https://skia-review.googlesource.com/149231
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/effects/GrRRectBlurEffect.cpp b/src/gpu/effects/GrRRectBlurEffect.cpp
index e9659f5..ac17b17 100644
--- a/src/gpu/effects/GrRRectBlurEffect.cpp
+++ b/src/gpu/effects/GrRRectBlurEffect.cpp
@@ -91,7 +91,7 @@
" translatedFragPos.y -= float(middle.y) - 1.0;\n}\nhalf2 proxyDims = "
"half2(half(2.0 * float(threshold) + 1.0));\nhalf2 texCoord = translatedFragPos / "
"proxyDims;\n%s = %s * texture(%s, float2(texCoord)).%s;\n",
- args.fOutputColor, args.fInputColor ? args.fInputColor : "half4(1)",
+ args.fOutputColor, args.fInputColor,
fragBuilder->getProgramBuilder()->samplerVariable(args.fTexSamplers[0]).c_str(),
fragBuilder->getProgramBuilder()->samplerSwizzle(args.fTexSamplers[0]).c_str());
}