Revert "Child fragment processors are now written as separate functions"
This reverts commit 0364bde2c49616bc9d2f68742d36bfedbeb7e950.
Reason for revert: bot breakage, e.g. https://chromium-swarm.appspot.com/task?id=44942724fab4b710 and https://chromium-swarm.appspot.com/task?id=44938767e5fbb810
Original change's description:
> Child fragment processors are now written as separate functions
> instead of inline
>
> Bug: skia:
> Change-Id: I3c6c876fea9cfcc311fc09c0fdf0375b776004aa
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210632
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
TBR=ethannicholas@google.com,michaelludwig@google.com
Change-Id: If33c1f554a090cd7541878e77712d5ce968ec70a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211943
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/gradients/generated/GrTiledGradientEffect.cpp b/src/gpu/gradients/generated/GrTiledGradientEffect.cpp
index 28a0832..cf5d583 100644
--- a/src/gpu/gradients/generated/GrTiledGradientEffect.cpp
+++ b/src/gpu/gradients/generated/GrTiledGradientEffect.cpp
@@ -29,24 +29,25 @@
(void)makePremul;
auto colorsAreOpaque = _outer.colorsAreOpaque;
(void)colorsAreOpaque;
- fragBuilder->codeAppendf("half4 _process447;");
- this->invokeChild(_outer.gradLayout_index, "_process447", args);
+ SkString _child1("_child1");
+ this->emitChild(_outer.gradLayout_index, &_child1, args);
fragBuilder->codeAppendf(
- "half4 t = _process447;\nif (!%s && t.y < 0.0) {\n %s = half4(0.0);\n} else {\n "
- " @if (%s) {\n half t_1 = t.x - 1.0;\n half tiled_t = (t_1 - 2.0 * "
+ "half4 t = %s;\nif (!%s && t.y < 0.0) {\n %s = half4(0.0);\n} else {\n @if "
+ "(%s) {\n half t_1 = t.x - 1.0;\n half tiled_t = (t_1 - 2.0 * "
"floor(t_1 * 0.5)) - 1.0;\n if (sk_Caps.mustDoOpBetweenFloorAndAbs) {\n "
" tiled_t = clamp(tiled_t, -1.0, 1.0);\n }\n t.x = "
"abs(tiled_t);\n } else {\n t.x = fract(t.x);\n }",
+ _child1.c_str(),
(_outer.childProcessor(_outer.gradLayout_index).preservesOpaqueInput() ? "true"
: "false"),
args.fOutputColor, (_outer.mirror ? "true" : "false"));
SkString _input0("t");
- fragBuilder->codeAppendf("half4 _process1459;");
- this->invokeChild(_outer.colorizer_index, _input0.c_str(), "_process1459", args);
- fragBuilder->codeAppendf(
- "\n %s = _process1459;\n}\n@if (%s) {\n %s.xyz *= %s.w;\n}\n",
- args.fOutputColor, (_outer.makePremul ? "true" : "false"), args.fOutputColor,
- args.fOutputColor);
+ SkString _child0("_child0");
+ this->emitChild(_outer.colorizer_index, _input0.c_str(), &_child0, args);
+ fragBuilder->codeAppendf("\n %s = %s;\n}\n@if (%s) {\n %s.xyz *= %s.w;\n}\n",
+ args.fOutputColor, _child0.c_str(),
+ (_outer.makePremul ? "true" : "false"), args.fOutputColor,
+ args.fOutputColor);
}
private: