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

#include <SkSLChildCall.h>

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

Public Member Functions

 ChildCall (Position pos, const Type *type, const Variable *child, ExpressionArray arguments)
 
const Variablechild () const
 
ExpressionArrayarguments ()
 
const ExpressionArrayarguments () 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 Member Functions

static std::unique_ptr< ExpressionMake (const Context &context, Position pos, const Type *returnType, const Variable &child, ExpressionArray arguments)
 
- 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::kChildCall
 

Additional Inherited Members

- Public Types inherited from SkSL::Expression
enum class  ComparisonResult { kUnknown = -1 , kNotEqual , kEqual }
 
using Kind = ExpressionKind
 
- 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

A call to a child effect object (shader, color filter, or blender).

Definition at line 31 of file SkSLChildCall.h.

Constructor & Destructor Documentation

◆ ChildCall()

SkSL::ChildCall::ChildCall ( Position  pos,
const Type type,
const Variable child,
ExpressionArray  arguments 
)
inline

Definition at line 35 of file SkSLChildCall.h.

36 : INHERITED(pos, kIRNodeKind, type)
37 , fChild(*child)
38 , fArguments(std::move(arguments)) {}
SkPoint pos
static constexpr Kind kIRNodeKind
ExpressionArray & arguments()
const Variable & child() const
virtual const Type & type() const

Member Function Documentation

◆ arguments() [1/2]

ExpressionArray & SkSL::ChildCall::arguments ( )
inline

Definition at line 51 of file SkSLChildCall.h.

51 {
52 return fArguments;
53 }

◆ arguments() [2/2]

const ExpressionArray & SkSL::ChildCall::arguments ( ) const
inline

Definition at line 55 of file SkSLChildCall.h.

55 {
56 return fArguments;
57 }

◆ child()

const Variable & SkSL::ChildCall::child ( ) const
inline

Definition at line 47 of file SkSLChildCall.h.

47 {
48 return fChild;
49 }

◆ clone()

std::unique_ptr< Expression > SkSL::ChildCall::clone ( Position  pos) const
overridevirtual

Implements SkSL::Expression.

Definition at line 23 of file SkSLChildCall.cpp.

23 {
24 return std::make_unique<ChildCall>(pos, &this->type(), &this->child(),
25 this->arguments().clone());
26}
std::unique_ptr< Expression > clone() const

◆ description()

std::string SkSL::ChildCall::description ( OperatorPrecedence  ) const
overridevirtual

Implements SkSL::Expression.

Definition at line 28 of file SkSLChildCall.cpp.

28 {
29 std::string result = std::string(this->child().name()) + ".eval(";
30 auto separator = SkSL::String::Separator();
31 for (const std::unique_ptr<Expression>& arg : this->arguments()) {
32 result += separator();
33 result += arg->description(OperatorPrecedence::kSequence);
34 }
35 result += ")";
36 return result;
37}
GAsyncResult * result
const char * name
Definition fuchsia.cc:50
std::string void void auto Separator()
Definition SkSLString.h:30

◆ Make()

std::unique_ptr< Expression > SkSL::ChildCall::Make ( const Context context,
Position  pos,
const Type returnType,
const Variable child,
ExpressionArray  arguments 
)
static

Definition at line 66 of file SkSLChildCall.cpp.

70 {
72 return std::make_unique<ChildCall>(pos, returnType, &child, std::move(arguments));
73}
#define SkASSERT(cond)
Definition SkAssert.h:116
static bool call_signature_is_valid(const Context &context, const Variable &child, const ExpressionArray &arguments)

Member Data Documentation

◆ kIRNodeKind

constexpr Kind SkSL::ChildCall::kIRNodeKind = Kind::kChildCall
inlinestaticconstexpr

Definition at line 33 of file SkSLChildCall.h.


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