fixed sksl static ifs to work for CircleEffect
static ifs (and switches) in .fp files are a bit tricky, because they
aren't necessarily static when the CPP file is being produced. They
become static when the CPP file produces the final SkSL; at this point
the final values of the 'in' variables are known.
This change permits 'deferred' static ifs and switches. The initial
compilation (.fp -> .cpp) passes the @if / @switch through, and then
the final compilation (.cpp's generated SkSL -> GLSL or whatever)
enforces the static test.
Bug: skia:
Change-Id: I0087dfe1725c8fd350507ac77f64db1d82659cdf
Reviewed-on: https://skia-review.googlesource.com/23403
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLGLSLCodeGenerator.h b/src/sksl/SkSLGLSLCodeGenerator.h
index 5716bde..6fe25d3 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.h
+++ b/src/sksl/SkSLGLSLCodeGenerator.h
@@ -162,7 +162,7 @@
void writeBlock(const Block& b);
- void writeIfStatement(const IfStatement& stmt);
+ virtual void writeIfStatement(const IfStatement& stmt);
void writeForStatement(const ForStatement& f);
@@ -170,7 +170,7 @@
void writeDoStatement(const DoStatement& d);
- void writeSwitchStatement(const SwitchStatement& s);
+ virtual void writeSwitchStatement(const SwitchStatement& s);
void writeReturnStatement(const ReturnStatement& r);