aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/ir/SkSLIfStatement.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sksl/ir/SkSLIfStatement.h')
-rw-r--r--src/sksl/ir/SkSLIfStatement.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sksl/ir/SkSLIfStatement.h b/src/sksl/ir/SkSLIfStatement.h
index 0377b1253d..b09c10ee95 100644
--- a/src/sksl/ir/SkSLIfStatement.h
+++ b/src/sksl/ir/SkSLIfStatement.h
@@ -17,21 +17,27 @@ namespace SkSL {
* An 'if' statement.
*/
struct IfStatement : public Statement {
- IfStatement(Position position, std::unique_ptr<Expression> test,
+ IfStatement(Position position, bool isStatic, std::unique_ptr<Expression> test,
std::unique_ptr<Statement> ifTrue, std::unique_ptr<Statement> ifFalse)
: INHERITED(position, kIf_Kind)
+ , fIsStatic(isStatic)
, fTest(std::move(test))
, fIfTrue(std::move(ifTrue))
, fIfFalse(std::move(ifFalse)) {}
String description() const override {
- String result = "if (" + fTest->description() + ") " + fIfTrue->description();
+ String result;
+ if (fIsStatic) {
+ result += "@";
+ }
+ result += "if (" + fTest->description() + ") " + fIfTrue->description();
if (fIfFalse) {
result += " else " + fIfFalse->description();
}
return result;
}
+ bool fIsStatic;
std::unique_ptr<Expression> fTest;
std::unique_ptr<Statement> fIfTrue;
// may be null