Represent splat constructors with a dedicated ConstructorSplat class.
Change-Id: Ic9c3d688b571591d057ab6a4e998f1f9712a1b58
Bug: skia:11032
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/392117
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/src/sksl/SkSLRehydrator.cpp b/src/sksl/SkSLRehydrator.cpp
index 57eb9ea..e3eb784 100644
--- a/src/sksl/SkSLRehydrator.cpp
+++ b/src/sksl/SkSLRehydrator.cpp
@@ -18,6 +18,7 @@
#include "src/sksl/ir/SkSLConstructor.h"
#include "src/sksl/ir/SkSLConstructorArray.h"
#include "src/sksl/ir/SkSLConstructorDiagonalMatrix.h"
+#include "src/sksl/ir/SkSLConstructorSplat.h"
#include "src/sksl/ir/SkSLContinueStatement.h"
#include "src/sksl/ir/SkSLDiscardStatement.h"
#include "src/sksl/ir/SkSLDoStatement.h"
@@ -470,6 +471,12 @@
return ConstructorDiagonalMatrix::Make(fContext, /*offset=*/-1, *type,
std::move(args[0]));
}
+ case Rehydrator::kConstructorSplat_Command: {
+ const Type* type = this->type();
+ ExpressionArray args = this->expressionArray();
+ SkASSERT(args.size() == 1);
+ return ConstructorSplat::Make(fContext, /*offset=*/-1, *type, std::move(args[0]));
+ }
case Rehydrator::kFieldAccess_Command: {
std::unique_ptr<Expression> base = this->expression();
int index = this->readU8();