aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLSwitchStatement.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sksl/ir/SkSLSwitchStatement.h')
-rw-r--r--src/sksl/ir/SkSLSwitchStatement.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/sksl/ir/SkSLSwitchStatement.h b/src/sksl/ir/SkSLSwitchStatement.h
index 68d0ef02df..2c48bad1ba 100644
--- a/src/sksl/ir/SkSLSwitchStatement.h
+++ b/src/sksl/ir/SkSLSwitchStatement.h
@@ -26,6 +26,15 @@ struct SwitchStatement : public Statement {
, fSymbols(std::move(symbols))
, fCases(std::move(cases)) {}
+ std::unique_ptr<Statement> clone() const override {
+ std::vector<std::unique_ptr<SwitchCase>> cloned;
+ for (const auto& s : fCases) {
+ cloned.push_back(std::unique_ptr<SwitchCase>((SwitchCase*) s->clone().release()));
+ }
+ return std::unique_ptr<Statement>(new SwitchStatement(fOffset, fIsStatic, fValue->clone(),
+ std::move(cloned), fSymbols));
+ }
+
String description() const override {
String result;
if (fIsStatic) {