Add sample(child, matrix) to SkSL.
This allows fragment processors to sample their children with their
local coordinate system transformed by a matrix.
Change-Id: Ifa848bbd85b939bbc5751fec5cf8f89ee904bf39
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282590
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/gpu/effects/generated/GrComposeLerpEffect.cpp b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
index 5224557..78aabac 100644
--- a/src/gpu/effects/generated/GrComposeLerpEffect.cpp
+++ b/src/gpu/effects/generated/GrComposeLerpEffect.cpp
@@ -72,14 +72,16 @@
, weight(src.weight) {
if (child1_index >= 0) {
auto clone = src.childProcessor(child1_index).clone();
- clone->setSampledWithExplicitCoords(
- src.childProcessor(child1_index).isSampledWithExplicitCoords());
+ if (src.childProcessor(child1_index).isSampledWithExplicitCoords()) {
+ clone->setSampledWithExplicitCoords();
+ }
this->registerChildProcessor(std::move(clone));
}
if (child2_index >= 0) {
auto clone = src.childProcessor(child2_index).clone();
- clone->setSampledWithExplicitCoords(
- src.childProcessor(child2_index).isSampledWithExplicitCoords());
+ if (src.childProcessor(child2_index).isSampledWithExplicitCoords()) {
+ clone->setSampledWithExplicitCoords();
+ }
this->registerChildProcessor(std::move(clone));
}
}