diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2018-01-17 13:51:52 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-17 20:09:37 +0000 |
commit | 8f6c2aba638c9397e9987fca7cbd8d0ff4b23e8f (patch) | |
tree | bc5a74f0de77fa7c5dbccfbbb479d6dccfdf1d38 /src/sksl/ir/SkSLConstructor.h | |
parent | adbe1328789071d1f742023edd93b6948eed9470 (diff) |
cleaned up SkSL constant handling
Bug: skia:
Change-Id: I8131c4348f0f91bc2705e493918c4ca2d1f4867b
Reviewed-on: https://skia-review.googlesource.com/95920
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/sksl/ir/SkSLConstructor.h')
-rw-r--r-- | src/sksl/ir/SkSLConstructor.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/sksl/ir/SkSLConstructor.h b/src/sksl/ir/SkSLConstructor.h index cea5265cea..b8824ba3d2 100644 --- a/src/sksl/ir/SkSLConstructor.h +++ b/src/sksl/ir/SkSLConstructor.h @@ -146,15 +146,11 @@ struct Constructor : public Expression { } double getFVecComponent(int index) const { - const Expression& c = this->getVecComponent(index); - ASSERT(c.fKind == Expression::kFloatLiteral_Kind); - return ((FloatLiteral&) c).fValue; + return this->getVecComponent(index).getConstantFloat(); } int64_t getIVecComponent(int index) const { - const Expression& c = this->getVecComponent(index); - ASSERT(c.fKind == Expression::kIntLiteral_Kind); - return ((IntLiteral&) c).fValue; + return this->getVecComponent(index).getConstantInt(); } // null return should be interpreted as zero |