SkSL: Rename isConstant to isCompileTimeConstant
This better reflects what the return value means, and eliminates
confusion with the SkSL concept of "const" variables, which are
not known at compile time.
Change-Id: I14973ceb36ae4ab6bad8a13bb93e1788a1b18bd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/299863
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/sksl/SkSLByteCodeGenerator.cpp b/src/sksl/SkSLByteCodeGenerator.cpp
index c484d7c..ce0dbf9 100644
--- a/src/sksl/SkSLByteCodeGenerator.cpp
+++ b/src/sksl/SkSLByteCodeGenerator.cpp
@@ -529,7 +529,7 @@
int length = i.fBase->fType.columns();
SkASSERT(length <= 255);
int offset = -1;
- if (i.fIndex->isConstant()) {
+ if (i.fIndex->isCompileTimeConstant()) {
int64_t index = i.fIndex->getConstantInt();
if (index < 0 || index >= length) {
fErrors.error(i.fIndex->fOffset, "Array index out of bounds.");
@@ -729,7 +729,7 @@
case Token::Kind::TK_SHR: {
SkASSERT(count == 1 && (tc == SkSL::TypeCategory::kSigned ||
tc == SkSL::TypeCategory::kUnsigned));
- if (!b.fRight->isConstant()) {
+ if (!b.fRight->isCompileTimeConstant()) {
fErrors.error(b.fRight->fOffset, "Shift amounts must be constant");
return false;
}