28 std::unique_ptr<Expression> constCtor) {
39 context,
pos, destType,
48 context,
pos, destType,
55 SkASSERT(numSlots == constCtor->type().slotCount());
57 double typecastArgs[16];
58 SkASSERT(numSlots <= std::size(typecastArgs));
59 for (
size_t index = 0; index < numSlots; ++index) {
60 std::optional<double> slotVal = constCtor->getConstantValue(index);
66 typecastArgs[index] = *slotVal;
75 std::unique_ptr<Expression> arg) {
86 arg->setPosition(
pos);
97 return std::make_unique<ConstructorCompoundCast>(
pos,
type, std::move(arg));
static std::unique_ptr< Expression > MakeConstantValueForVariable(Position pos, std::unique_ptr< Expression > expr)
static std::unique_ptr< Expression > Make(const Context &context, Position pos, const Type &type, std::unique_ptr< Expression > arg)
static std::unique_ptr< Expression > MakeFromConstants(const Context &context, Position pos, const Type &type, const double values[])
static std::unique_ptr< Expression > Make(const Context &context, Position pos, const Type &type, std::unique_ptr< Expression > arg)
static std::unique_ptr< Expression > Make(const Context &context, Position pos, const Type &type, std::unique_ptr< Expression > arg)
static std::unique_ptr< Expression > Make(const Context &context, Position pos, const Type &type, std::unique_ptr< Expression > arg)
virtual const Type & type() const
std::unique_ptr< Expression > & argument()
virtual bool isVector() const
bool isAllowedInES2(const Context &context) const
virtual const Type & componentType() const
bool matches(const Type &other) const
virtual bool isMatrix() const
virtual int columns() const
virtual size_t slotCount() const
bool checkForOutOfRangeLiteral(const Context &context, const Expression &expr) const
bool IsCompileTimeConstant(const Expression &expr)
static std::unique_ptr< Expression > cast_constant_composite(const Context &context, Position pos, const Type &destType, std::unique_ptr< Expression > constCtor)