Update generated effects to use views.
Bug: skia:9556
Change-Id: Iad4f7f2db2624e699184691d8aae2aaded81eb28
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270198
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp
index c284315..6d40b61 100644
--- a/src/sksl/SkSLHCodeGenerator.cpp
+++ b/src/sksl/SkSLHCodeGenerator.cpp
@@ -66,7 +66,7 @@
} else if (type == *context.fFloat4x4_Type || type == *context.fHalf4x4_Type) {
return Layout::CType::kSkM44;
} else if (type.kind() == Type::kSampler_Kind) {
- return Layout::CType::kGrSurfaceProxy;
+ return Layout::CType::kGrSurfaceProxyView;
} else if (type == *context.fFragmentProcessor_Type) {
return Layout::CType::kGrFragmentProcessor;
}
@@ -191,7 +191,8 @@
fFullName.c_str());
separator = "";
for (const auto& param : fSectionAndParameterHelper.getParameters()) {
- if (param->fType.nonnullable() == *fContext.fFragmentProcessor_Type) {
+ if (param->fType.nonnullable() == *fContext.fFragmentProcessor_Type ||
+ param->fType.nonnullable().kind() == Type::kSampler_Kind) {
this->writef("%sstd::move(%s)", separator, String(param->fName).c_str());
} else {
this->writef("%s%s", separator, String(param->fName).c_str());
@@ -241,7 +242,7 @@
const Section& s = *transforms[i];
String field = CoordTransformName(s.fArgument.c_str(), i);
if (s.fArgument.size()) {
- this->writef("\n , %s(%s, %s.get())", field.c_str(), s.fText.c_str(),
+ this->writef("\n , %s(%s, %s.proxy())", field.c_str(), s.fText.c_str(),
FieldName(s.fArgument.c_str()).c_str());
}
else {