Make invokeChild default to fInputColor, rather than half4(1)
By extension, this changes the default behavior of sample() in .fp
files. This lets us remove the explicit fInputColor/sk_InColor
arguments everywhere. Most sites that were using the default no
longer care what's passed, as the child is known to be a texture
effect that will ignore the input color. The few remaining sites
now explicitly pass half4(1) when necessary.
Change-Id: Ie4691b049f905d098e9befe8bd07706a496f2968
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303356
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
diff --git a/src/gpu/effects/generated/GrComposeLerpEffect.cpp b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
index 905b406..e551b2b 100644
--- a/src/gpu/effects/generated/GrComposeLerpEffect.cpp
+++ b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
@@ -27,14 +27,13 @@
(void)weight;
weightVar = args.fUniformHandler->addUniform(&_outer, kFragment_GrShaderFlag,
kFloat_GrSLType, "weight");
- SkString _sample290 = this->invokeChild(0, args);
- SkString _sample358 = this->invokeChild(1, args);
+ SkString _sample273 = this->invokeChild(0, args);
+ SkString _sample289 = this->invokeChild(1, args);
fragBuilder->codeAppendf(
- R"SkSL(%s = mix(%s ? %s : %s, %s ? %s : %s, half(%s));
+ R"SkSL(%s = mix(%s, %s, half(%s));
)SkSL",
- args.fOutputColor, _outer.childProcessor(0) ? "true" : "false", _sample290.c_str(),
- args.fInputColor, _outer.childProcessor(1) ? "true" : "false", _sample358.c_str(),
- args.fInputColor, args.fUniformHandler->getUniformCStr(weightVar));
+ args.fOutputColor, _sample273.c_str(), _sample289.c_str(),
+ args.fUniformHandler->getUniformCStr(weightVar));
}
private: