Add Type::isArray and Type::isStruct helper methods.
These methods improve readability for simple, commonly-performed type
checks.
We already had a (very rarely-used) helper function `isArrayed` which
was only applicable to texture and sampler types. To avoid potential
confusion, this has been renamed to `isArrayedTexture`.
Change-Id: Ibec9d872ff3b415964b842c96ddc1b5b271ac883
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340720
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/SkSLInliner.cpp b/src/sksl/SkSLInliner.cpp
index 34e3b8b..f1e4052 100644
--- a/src/sksl/SkSLInliner.cpp
+++ b/src/sksl/SkSLInliner.cpp
@@ -195,7 +195,7 @@
}
static const Type* copy_if_needed(const Type* src, SymbolTable& symbolTable) {
- if (src->typeKind() == Type::TypeKind::kArray) {
+ if (src->isArray()) {
const Type* innerType = copy_if_needed(&src->componentType(), symbolTable);
return symbolTable.takeOwnershipOfSymbol(std::make_unique<Type>(src->name(),
src->typeKind(),