Flutter Engine
The Flutter Engine
|
#include <SkSLFunctionDeclaration.h>
Public Types | |
using | ParamTypes = skia_private::STArray< 8, const Type * > |
Public Types inherited from SkSL::Symbol | |
using | Kind = SymbolKind |
Public Member Functions | |
FunctionDeclaration (const Context &context, Position pos, ModifierFlags modifierFlags, std::string_view name, skia_private::TArray< Variable * > parameters, const Type *returnType, IntrinsicKind intrinsicKind) | |
ModifierFlags | modifierFlags () const |
void | setModifierFlags (ModifierFlags m) |
const FunctionDefinition * | definition () const |
void | setDefinition (const FunctionDefinition *definition) |
void | setNextOverload (FunctionDeclaration *overload) |
SkSpan< Variable *const > | parameters () const |
const Type & | returnType () const |
bool | isBuiltin () const |
bool | isMain () const |
IntrinsicKind | intrinsicKind () const |
bool | isIntrinsic () const |
const FunctionDeclaration * | nextOverload () const |
FunctionDeclaration * | mutableNextOverload () const |
std::string | mangledName () const |
std::string | description () const override |
bool | matches (const FunctionDeclaration &f) const |
const Variable * | getMainCoordsParameter () const |
const Variable * | getMainInputColorParameter () const |
const Variable * | getMainDestColorParameter () const |
bool | determineFinalTypes (const ExpressionArray &arguments, ParamTypes *outParameterTypes, const Type **outReturnType) const |
Public Member Functions inherited from SkSL::Symbol | |
Symbol (Position pos, Kind kind, std::string_view name, const Type *type=nullptr) | |
~Symbol () override | |
std::unique_ptr< Expression > | instantiate (const Context &context, Position pos) const |
const Type & | type () const |
Kind | kind () const |
std::string_view | name () const |
void | setName (std::string_view newName) |
Public Member Functions inherited from SkSL::IRNode | |
virtual | ~IRNode () |
virtual std::string | description () const =0 |
IRNode (const IRNode &)=delete | |
IRNode & | operator= (const IRNode &)=delete |
Position | position () const |
void | setPosition (Position p) |
template<typename T > | |
bool | is () const |
template<typename T > | |
const T & | as () const |
template<typename T > | |
T & | as () |
Static Public Member Functions | |
static FunctionDeclaration * | Convert (const Context &context, Position pos, const Modifiers &modifiers, std::string_view name, skia_private::TArray< std::unique_ptr< Variable > > parameters, Position returnTypePos, const Type *returnType) |
Static Public Member Functions inherited from SkSL::Poolable | |
static void * | operator new (const size_t size) |
static void | operator delete (void *ptr) |
Static Public Attributes | |
static constexpr Kind | kIRNodeKind = Kind::kFunctionDeclaration |
Additional Inherited Members | |
Public Attributes inherited from SkSL::IRNode | |
Position | fPosition |
Protected Member Functions inherited from SkSL::IRNode | |
IRNode (Position position, int kind) | |
Protected Attributes inherited from SkSL::IRNode | |
int | fKind |
A function declaration (not a definition – does not contain a body).
Definition at line 36 of file SkSLFunctionDeclaration.h.
using SkSL::FunctionDeclaration::ParamTypes = skia_private::STArray<8, const Type*> |
Determine the effective types of this function's parameters and return value when called with the given arguments. This is relevant for functions with generic parameter types, where this will collapse the generic types down into specific concrete types.
Returns true if it was able to select a concrete set of types for the generic function, false if there is no possible way this can match the argument types. Note that even a true return does not guarantee that the function can be successfully called with those arguments, merely indicates that an attempt should be made. If false is returned, the state of outParameterTypes and outReturnType are undefined.
This always assumes narrowing conversions are allowed. The calling code needs to verify that each argument can actually be coerced to the final parameter type, respecting the narrowing-conversions flag. This is handled in callCost(), or in convertCall() (via coerce).
Definition at line 147 of file SkSLFunctionDeclaration.h.
SkSL::FunctionDeclaration::FunctionDeclaration | ( | const Context & | context, |
Position | pos, | ||
ModifierFlags | modifierFlags, | ||
std::string_view | name, | ||
skia_private::TArray< Variable * > | parameters, | ||
const Type * | returnType, | ||
IntrinsicKind | intrinsicKind | ||
) |
Definition at line 415 of file SkSLFunctionDeclaration.cpp.
|
static |
Definition at line 462 of file SkSLFunctionDeclaration.cpp.
|
inline |
Definition at line 64 of file SkSLFunctionDeclaration.h.
|
overridevirtual |
Implements SkSL::IRNode.
Definition at line 534 of file SkSLFunctionDeclaration.cpp.
bool SkSL::FunctionDeclaration::determineFinalTypes | ( | const ExpressionArray & | arguments, |
ParamTypes * | outParameterTypes, | ||
const Type ** | outReturnType | ||
) | const |
Definition at line 563 of file SkSLFunctionDeclaration.cpp.
|
inline |
If this function is main(), and it has the requested parameter, returns that parameter. For instance, only a runtime-blend program will have a dest-color parameter, in parameter 1; getMainDestColorParameter
will return that parameter if this is a runtime-blend main() function. Otherwise, null is returned.
Definition at line 122 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 128 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 125 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 94 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 86 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 98 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 90 of file SkSLFunctionDeclaration.h.
std::string SkSL::FunctionDeclaration::mangledName | ( | ) | const |
Definition at line 512 of file SkSLFunctionDeclaration.cpp.
bool SkSL::FunctionDeclaration::matches | ( | const FunctionDeclaration & | f | ) | const |
Definition at line 546 of file SkSLFunctionDeclaration.cpp.
|
inline |
Definition at line 56 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 106 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 102 of file SkSLFunctionDeclaration.h.
Definition at line 78 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 82 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 68 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 60 of file SkSLFunctionDeclaration.h.
|
inline |
Definition at line 73 of file SkSLFunctionDeclaration.h.
|
inlinestaticconstexpr |
Definition at line 38 of file SkSLFunctionDeclaration.h.