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

#include <SkSLVariable.h>

Inheritance diagram for SkSL::ExtendedVariable:
SkSL::Variable SkSL::Symbol SkSL::IRNode SkSL::Poolable

Public Member Functions

 ExtendedVariable (Position pos, Position modifiersPosition, const Layout &layout, ModifierFlags flags, std::string_view name, const Type *type, bool builtin, Storage storage, std::string mangledName)
 
 ~ExtendedVariable () override
 
InterfaceBlockinterfaceBlock () const override
 
const Layoutlayout () const override
 
void setInterfaceBlock (InterfaceBlock *elem) override
 
void detachDeadInterfaceBlock () override
 
std::string_view mangledName () const override
 
- Public Member Functions inherited from SkSL::Variable
 Variable (Position pos, Position modifiersPosition, ModifierFlags modifierFlags, std::string_view name, const Type *type, bool builtin, Storage storage)
 
 ~Variable () override
 
ModifierFlags modifierFlags () const
 
Position modifiersPosition () const
 
bool isBuiltin () const
 
Storage storage () const
 
const ExpressioninitialValue () const
 
VarDeclarationvarDeclaration () const
 
void setVarDeclaration (VarDeclaration *declaration)
 
GlobalVarDeclarationglobalVarDeclaration () const
 
void setGlobalVarDeclaration (GlobalVarDeclaration *global)
 
void detachDeadVarDeclaration ()
 
std::string description () const override
 
- 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< Expressioninstantiate (const Context &context, Position pos) const
 
const Typetype () const
 
Kind kind () const
 
std::string_view name () const
 
void setName (std::string_view newName)
 
- 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 ()
 

Additional Inherited Members

- Public Types inherited from SkSL::Variable
using Storage = VariableStorage
 
- Public Types inherited from SkSL::Symbol
using Kind = SymbolKind
 
- Static Public Member Functions inherited from SkSL::Variable
static std::unique_ptr< VariableConvert (const Context &context, Position pos, Position modifiersPos, const Layout &layout, ModifierFlags flags, const Type *type, Position namePos, std::string_view name, Storage storage)
 
static std::unique_ptr< VariableMake (Position pos, Position modifiersPosition, const Layout &layout, ModifierFlags flags, const Type *type, std::string_view name, std::string mangledName, bool builtin, Storage storage)
 
static ScratchVariable MakeScratchVariable (const Context &context, Mangler &mangler, std::string_view baseName, const Type *type, SymbolTable *symbolTable, std::unique_ptr< Expression > initialValue)
 
- 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
 
- Static Public Attributes inherited from SkSL::Variable
static constexpr Kind kIRNodeKind = Kind::kVariable
 
- Protected Member Functions inherited from SkSL::IRNode
 IRNode (Position position, int kind)
 
- Protected Attributes inherited from SkSL::IRNode
int fKind
 

Detailed Description

ExtendedVariable is functionally equivalent to a regular Variable, but it also contains extra fields that most variables don't need:

Some of these fields can be null/empty.

Definition at line 158 of file SkSLVariable.h.

Constructor & Destructor Documentation

◆ ExtendedVariable()

SkSL::ExtendedVariable::ExtendedVariable ( Position  pos,
Position  modifiersPosition,
const Layout layout,
ModifierFlags  flags,
std::string_view  name,
const Type type,
bool  builtin,
Storage  storage,
std::string  mangledName 
)
inline

Definition at line 160 of file SkSLVariable.h.

163 : INHERITED(pos, modifiersPosition, flags, name, type, builtin, storage)
164 , fLayout(layout)
165 , fMangledName(std::move(mangledName)) {}
SkPoint pos
const Layout & layout() const override
std::string_view mangledName() const override
std::string_view name() const
Definition SkSLSymbol.h:51
const Type & type() const
Definition SkSLSymbol.h:42
Storage storage() const
Position modifiersPosition() const
FlutterSemanticsFlag flags

◆ ~ExtendedVariable()

SkSL::ExtendedVariable::~ExtendedVariable ( )
override

Definition at line 38 of file SkSLVariable.cpp.

38 {
39 // Unhook this Variable from its associated InterfaceBlock, since we're being deleted.
40 if (fInterfaceBlockElement) {
41 fInterfaceBlockElement->detachDeadVariable();
42 }
43}

Member Function Documentation

◆ detachDeadInterfaceBlock()

void SkSL::ExtendedVariable::detachDeadInterfaceBlock ( )
inlineoverridevirtual

Reimplemented from SkSL::Variable.

Definition at line 182 of file SkSLVariable.h.

182 {
183 // The InterfaceBlock is being deleted, so our reference to it has become stale.
184 fInterfaceBlockElement = nullptr;
185 }

◆ interfaceBlock()

InterfaceBlock * SkSL::ExtendedVariable::interfaceBlock ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Variable.

Definition at line 169 of file SkSLVariable.h.

169 {
170 return fInterfaceBlockElement;
171 }

◆ layout()

const Layout & SkSL::ExtendedVariable::layout ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Variable.

Definition at line 173 of file SkSLVariable.h.

173 {
174 return fLayout;
175 }

◆ mangledName()

std::string_view SkSL::ExtendedVariable::mangledName ( ) const
overridevirtual

Reimplemented from SkSL::Variable.

Definition at line 88 of file SkSLVariable.cpp.

88 {
89 return fMangledName.empty() ? this->name() : fMangledName;
90}

◆ setInterfaceBlock()

void SkSL::ExtendedVariable::setInterfaceBlock ( InterfaceBlock elem)
inlineoverridevirtual

Reimplemented from SkSL::Variable.

Definition at line 177 of file SkSLVariable.h.

177 {
178 SkASSERT(!fInterfaceBlockElement);
179 fInterfaceBlockElement = elem;
180 }
#define SkASSERT(cond)
Definition SkAssert.h:116

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