Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
SkSL::MethodReference Class Referencefinal

#include <SkSLMethodReference.h>

Inheritance diagram for SkSL::MethodReference:
SkSL::Expression SkSL::IRNode SkSL::Poolable

Public Member Functions

 MethodReference (const Context &context, Position pos, std::unique_ptr< Expression > self, const FunctionDeclaration *overloadChain)
 
std::unique_ptr< Expression > & self ()
 
const std::unique_ptr< Expression > & self () const
 
const FunctionDeclarationoverloadChain () const
 
std::unique_ptr< Expressionclone (Position pos) const override
 
std::string description (OperatorPrecedence) const override
 
- Public Member Functions inherited from SkSL::Expression
 Expression (Position pos, Kind kind, const Type *type)
 
Kind kind () const
 
virtual const Typetype () const
 
bool isAnyConstructor () const
 
bool isIntLiteral () const
 
bool isFloatLiteral () const
 
bool isBoolLiteral () const
 
AnyConstructorasAnyConstructor ()
 
const AnyConstructorasAnyConstructor () const
 
bool isIncomplete (const Context &context) const
 
virtual ComparisonResult compareConstant (const Expression &other) const
 
CoercionCost coercionCost (const Type &target) const
 
virtual bool supportsConstantValues () const
 
virtual std::optional< double > getConstantValue (int n) const
 
std::unique_ptr< Expressionclone () const
 
std::string description () const final
 
- Public Member Functions inherited from SkSL::IRNode
virtual ~IRNode ()
 
 IRNode (const IRNode &)=delete
 
IRNodeoperator= (const IRNode &)=delete
 
Position position () const
 
void setPosition (Position p)
 
template<typename T >
bool is () const
 
template<typename T >
const Tas () const
 
template<typename T >
Tas ()
 

Static Public Attributes

static constexpr Kind kIRNodeKind = Kind::kMethodReference
 

Additional Inherited Members

- Public Types inherited from SkSL::Expression
enum class  ComparisonResult { kUnknown = -1 , kNotEqual , kEqual }
 
using Kind = ExpressionKind
 
- Static Public Member Functions inherited from SkSL::Poolable
static void * operator new (const size_t size)
 
static void operator delete (void *ptr)
 
- 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
 

Detailed Description

An identifier referring to a method name, along with an instance for the call. This is an intermediate value: MethodReferences are always eventually replaced by FunctionCalls in valid programs.

Method calls are only supported on effect-child types, and they all resolve to intrinsics prefixed with '$', and taking the 'self' object as the last parameter. For example:

uniform shader child; ... child.eval(xy) --> $eval(xy, child)

Definition at line 31 of file SkSLMethodReference.h.

Constructor & Destructor Documentation

◆ MethodReference()

SkSL::MethodReference::MethodReference ( const Context context,
Position  pos,
std::unique_ptr< Expression self,
const FunctionDeclaration overloadChain 
)
inline

Definition at line 35 of file SkSLMethodReference.h.

39 : INHERITED(pos, kIRNodeKind, context.fTypes.fInvalid.get())
40 , fSelf(std::move(self))
41 , fOverloadChain(overloadChain) {}
SkPoint pos
const FunctionDeclaration * overloadChain() const
std::unique_ptr< Expression > & self()
static constexpr Kind kIRNodeKind

Member Function Documentation

◆ clone()

std::unique_ptr< Expression > SkSL::MethodReference::clone ( Position  pos) const
inlineoverridevirtual

Implements SkSL::Expression.

Definition at line 48 of file SkSLMethodReference.h.

48 {
49 return std::unique_ptr<Expression>(new MethodReference(
50 pos, this->self()->clone(), this->overloadChain(), &this->type()));
51 }
virtual const Type & type() const
std::unique_ptr< Expression > clone() const
MethodReference(const Context &context, Position pos, std::unique_ptr< Expression > self, const FunctionDeclaration *overloadChain)

◆ description()

std::string SkSL::MethodReference::description ( OperatorPrecedence  ) const
inlineoverridevirtual

Implements SkSL::Expression.

Definition at line 53 of file SkSLMethodReference.h.

53 {
54 return "<method>";
55 }

◆ overloadChain()

const FunctionDeclaration * SkSL::MethodReference::overloadChain ( ) const
inline

Definition at line 46 of file SkSLMethodReference.h.

46{ return fOverloadChain; }

◆ self() [1/2]

std::unique_ptr< Expression > & SkSL::MethodReference::self ( )
inline

Definition at line 43 of file SkSLMethodReference.h.

43{ return fSelf; }

◆ self() [2/2]

const std::unique_ptr< Expression > & SkSL::MethodReference::self ( ) const
inline

Definition at line 44 of file SkSLMethodReference.h.

44{ return fSelf; }

Member Data Documentation

◆ kIRNodeKind

constexpr Kind SkSL::MethodReference::kIRNodeKind = Kind::kMethodReference
inlinestaticconstexpr

Definition at line 33 of file SkSLMethodReference.h.


The documentation for this class was generated from the following file: