Lines Matching refs:value
19 * A literal value. These can contain ints, floats, or booleans.
26 Literal(int line, double value, const Type* type)
28 , fValue(value) {}
31 static std::unique_ptr<Literal> MakeFloat(const Context& context, int line, float value) {
32 return std::make_unique<Literal>(line, value, context.fTypes.fFloatLiteral.get());
36 static std::unique_ptr<Literal> MakeFloat(int line, float value, const Type* type) {
38 return std::make_unique<Literal>(line, value, type);
42 static std::unique_ptr<Literal> MakeInt(const Context& context, int line, SKSL_INT value) {
43 return std::make_unique<Literal>(line, value, context.fTypes.fIntLiteral.get());
47 static std::unique_ptr<Literal> MakeInt(int line, SKSL_INT value, const Type* type) {
49 SkASSERTF(value >= type->minimumValue(), "Value %" PRId64 " does not fit in type %s",
50 value, type->description().c_str());
51 SkASSERTF(value <= type->maximumValue(), "Value %" PRId64 " does not fit in type %s",
52 value, type->description().c_str());
53 return std::make_unique<Literal>(line, value, type);
57 static std::unique_ptr<Literal> MakeBool(const Context& context, int line, bool value) {
58 return std::make_unique<Literal>(line, value, context.fTypes.fBool.get());
63 static std::unique_ptr<Literal> MakeBool(int line, bool value, const Type* type) {
65 return std::make_unique<Literal>(line, value, type);
69 static std::unique_ptr<Literal> Make(int line, double value, const Type* type) {
71 return MakeFloat(line, value, type);
74 return MakeInt(line, value, type);
77 return MakeBool(line, value, type);
95 double value() const {
122 return this->value() == other.as<Literal>().value()
128 return std::make_unique<Literal>(fLine, this->value(), &this->type());