Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkSL::AliasType Class Referencefinal
Inheritance diagram for SkSL::AliasType:
SkSL::Type SkSL::Symbol SkSL::IRNode SkSL::Poolable

Public Member Functions

 AliasType (std::string_view name, const Type &targetType)
 
const Typeresolve () const override
 
const TypecomponentType () const override
 
NumberKind numberKind () const override
 
int priority () const override
 
int columns () const override
 
int rows () const override
 
int bitWidth () const override
 
bool isAllowedInES2 () const override
 
size_t slotCount () const override
 
const TypeslotType (size_t n) const override
 
SpvDim_ dimensions () const override
 
bool isDepth () const override
 
bool isArrayedTexture () const override
 
bool isScalar () const override
 
bool isLiteral () const override
 
bool isVector () const override
 
bool isMatrix () const override
 
bool isArray () const override
 
bool isUnsizedArray () const override
 
bool isStruct () const override
 
bool isInterfaceBlock () const override
 
bool isMultisampled () const override
 
TextureAccess textureAccess () const override
 
SkSpan< const Type *const > coercibleTypes () const override
 
- Public Member Functions inherited from SkSL::Type
 Type (const Type &other)=delete
 
std::string getArrayName (int arraySize) const
 
template<typename T >
bool is () const
 
template<typename T >
const Tas () const
 
template<typename T >
Tas ()
 
const Typeclone (const Context &context, SymbolTable *symbolTable) const
 
virtual bool isBuiltin () const
 
std::string displayName () const
 
std::string description () const override
 
bool isAllowedInES2 (const Context &context) const
 
virtual bool isAllowedInES2 () const
 
virtual bool isAllowedInUniform (Position *errorPosition=nullptr) const
 
virtual const Typeresolve () const
 
bool matches (const Type &other) const
 
const char * abbreviatedName () const
 
TypeKind typeKind () const
 
virtual NumberKind numberKind () const
 
bool isBoolean () const
 
bool isNumber () const
 
bool isFloat () const
 
bool isSigned () const
 
bool isUnsigned () const
 
bool isInteger () const
 
bool isOpaque () const
 
bool isStorageTexture () const
 
virtual int priority () const
 
bool canCoerceTo (const Type &other, bool allowNarrowing) const
 
CoercionCost coercionCost (const Type &other) const
 
virtual const TypecomponentType () const
 
const TypecolumnType (const Context &context) const
 
virtual const TypetextureType () const
 
virtual int columns () const
 
virtual int rows () const
 
virtual double minimumValue () const
 
virtual double maximumValue () const
 
virtual size_t slotCount () const
 
virtual const TypeslotType (size_t) const
 
virtual SkSpan< const Fieldfields () const
 
virtual SkSpan< const Type *const > coercibleTypes () const
 
virtual SpvDim_ dimensions () const
 
virtual bool isDepth () const
 
virtual bool isArrayedTexture () const
 
bool isVoid () const
 
bool isGeneric () const
 
bool isSampler () const
 
bool isAtomic () const
 
virtual bool isScalar () const
 
virtual bool isLiteral () const
 
virtual const TypescalarTypeForLiteral () const
 
virtual bool isVector () const
 
virtual bool isMatrix () const
 
virtual bool isArray () const
 
virtual bool isUnsizedArray () const
 
virtual bool isStruct () const
 
virtual bool isInterfaceBlock () const
 
bool isEffectChild () const
 
virtual bool isMultisampled () const
 
virtual TextureAccess textureAccess () const
 
bool hasPrecision () const
 
bool highPrecision () const
 
virtual int bitWidth () const
 
virtual bool isOrContainsArray () const
 
virtual bool isOrContainsUnsizedArray () const
 
virtual bool isOrContainsAtomic () const
 
const TypetoCompound (const Context &context, int columns, int rows) const
 
const TypeapplyQualifiers (const Context &context, ModifierFlags *modifierFlags, Position pos) const
 
std::unique_ptr< ExpressioncoerceExpression (std::unique_ptr< Expression > expr, const Context &context) const
 
bool checkForOutOfRangeLiteral (const Context &context, const Expression &expr) const
 
bool checkForOutOfRangeLiteral (const Context &context, double value, Position pos) const
 
bool checkIfUsableInArray (const Context &context, Position arrayPos) const
 
SKSL_INT convertArraySize (const Context &context, Position arrayPos, std::unique_ptr< Expression > size) const
 
SKSL_INT convertArraySize (const Context &context, Position arrayPos, Position sizePos, SKSL_INT size) 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< 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 ()
 
virtual std::string description () const =0
 
 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::Type
enum class  TypeKind : int8_t {
  kArray , kAtomic , kGeneric , kLiteral ,
  kMatrix , kOther , kSampler , kSeparateSampler ,
  kScalar , kStruct , kTexture , kVector ,
  kVoid , kColorFilter , kShader , kBlender
}
 
enum class  NumberKind : int8_t {
  kFloat , kSigned , kUnsigned , kBoolean ,
  kNonnumeric
}
 
enum class  TextureAccess : int8_t { kSample , kRead , kWrite , kReadWrite }
 
- Public Types inherited from SkSL::Symbol
using Kind = SymbolKind
 
- Static Public Member Functions inherited from SkSL::Type
static std::unique_ptr< TypeMakeArrayType (const Context &context, std::string_view name, const Type &componentType, int columns)
 
static std::unique_ptr< TypeMakeAliasType (std::string_view name, const Type &targetType)
 
static std::unique_ptr< TypeMakeGenericType (const char *name, SkSpan< const Type *const > types, const Type *slotType)
 
static std::unique_ptr< TypeMakeLiteralType (const char *name, const Type &scalarType, int8_t priority)
 
static std::unique_ptr< TypeMakeMatrixType (std::string_view name, const char *abbrev, const Type &componentType, int columns, int8_t rows)
 
static std::unique_ptr< TypeMakeSamplerType (const char *name, const Type &textureType)
 
static std::unique_ptr< TypeMakeScalarType (std::string_view name, const char *abbrev, Type::NumberKind numberKind, int8_t priority, int8_t bitWidth)
 
static std::unique_ptr< TypeMakeSpecialType (const char *name, const char *abbrev, Type::TypeKind typeKind)
 
static std::unique_ptr< TypeMakeStructType (const Context &context, Position pos, std::string_view name, skia_private::TArray< Field > fields, bool interfaceBlock=false)
 
static std::unique_ptr< TypeMakeTextureType (const char *name, SpvDim_ dimensions, bool isDepth, bool isArrayedTexture, bool isMultisampled, TextureAccess textureAccess)
 
static std::unique_ptr< TypeMakeVectorType (std::string_view name, const char *abbrev, const Type &componentType, int columns)
 
static std::unique_ptr< TypeMakeAtomicType (std::string_view name, const char *abbrev)
 
- 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::Type
static constexpr Kind kIRNodeKind = Kind::kType
 
static constexpr int kMaxAbbrevLength = 3
 
static constexpr int kUnsizedArray = -1
 
- Protected Member Functions inherited from SkSL::Type
 Type (std::string_view name, const char *abbrev, TypeKind kind, Position pos=Position())
 
const TypeapplyPrecisionQualifiers (const Context &context, ModifierFlags *modifierFlags, Position pos) const
 
const TypeapplyAccessQualifiers (const Context &context, ModifierFlags *modifierFlags, Position pos) const
 
bool isInRootSymbolTable () const
 
virtual int structNestingDepth () const
 
- Protected Member Functions inherited from SkSL::IRNode
 IRNode (Position position, int kind)
 
- Protected Attributes inherited from SkSL::IRNode
int fKind
 

Detailed Description

Definition at line 42 of file SkSLType.cpp.

Constructor & Destructor Documentation

◆ AliasType()

SkSL::AliasType::AliasType ( std::string_view  name,
const Type targetType 
)
inline

Definition at line 44 of file SkSLType.cpp.

45 : INHERITED(name, targetType.abbreviatedName(), targetType.typeKind())
46 , fTargetType(targetType) {}
std::string_view name() const
Definition: SkSLSymbol.h:51

Member Function Documentation

◆ bitWidth()

int SkSL::AliasType::bitWidth ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 72 of file SkSLType.cpp.

72 {
73 return fTargetType.bitWidth();
74 }
virtual int bitWidth() const
Definition: SkSLType.h:574

◆ coercibleTypes()

SkSpan< const Type *const > SkSL::AliasType::coercibleTypes ( ) const
inlineoverridevirtual

For generic types, returns the types that this generic type can substitute for.

Reimplemented from SkSL::Type.

Definition at line 140 of file SkSLType.cpp.

140 {
141 return fTargetType.coercibleTypes();
142 }
virtual SkSpan< const Type *const > coercibleTypes() const
Definition: SkSLType.h:476

◆ columns()

int SkSL::AliasType::columns ( ) const
inlineoverridevirtual

For matrices and vectors, returns the number of columns (e.g. both mat3 and float3 return 3). For scalars, returns 1. For arrays, returns either the size of the array (if known) or -1. For all other types, causes an assertion failure.

Reimplemented from SkSL::Type.

Definition at line 64 of file SkSLType.cpp.

64 {
65 return fTargetType.columns();
66 }
virtual int columns() const
Definition: SkSLType.h:429

◆ componentType()

const Type & SkSL::AliasType::componentType ( ) const
inlineoverridevirtual

For matrices and vectors, returns the type of individual cells (e.g. mat2 has a component type of Float). For arrays, returns the base type. For all other types, returns the type itself.

Reimplemented from SkSL::Type.

Definition at line 52 of file SkSLType.cpp.

52 {
53 return fTargetType.componentType();
54 }
virtual const Type & componentType() const
Definition: SkSLType.h:404

◆ dimensions()

SpvDim_ SkSL::AliasType::dimensions ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 88 of file SkSLType.cpp.

88 {
89 return fTargetType.dimensions();
90 }
virtual SpvDim_ dimensions() const
Definition: SkSLType.h:481

◆ isAllowedInES2()

bool SkSL::AliasType::isAllowedInES2 ( ) const
inlineoverridevirtual

Returns true if this type is legal to use in a strict-ES2 program.

Reimplemented from SkSL::Type.

Definition at line 76 of file SkSLType.cpp.

76 {
77 return fTargetType.isAllowedInES2();
78 }
bool isAllowedInES2(const Context &context) const

◆ isArray()

bool SkSL::AliasType::isArray ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 116 of file SkSLType.cpp.

116 {
117 return fTargetType.isArray();
118 }
virtual bool isArray() const
Definition: SkSLType.h:532

◆ isArrayedTexture()

bool SkSL::AliasType::isArrayedTexture ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 96 of file SkSLType.cpp.

96 {
97 return fTargetType.isArrayedTexture();
98 }
virtual bool isArrayedTexture() const
Definition: SkSLType.h:491

◆ isDepth()

bool SkSL::AliasType::isDepth ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 92 of file SkSLType.cpp.

92 {
93 return fTargetType.isDepth();
94 }
virtual bool isDepth() const
Definition: SkSLType.h:486

◆ isInterfaceBlock()

bool SkSL::AliasType::isInterfaceBlock ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 128 of file SkSLType.cpp.

128 {
129 return fTargetType.isInterfaceBlock();
130 }
virtual bool isInterfaceBlock() const
Definition: SkSLType.h:544

◆ isLiteral()

bool SkSL::AliasType::isLiteral ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 104 of file SkSLType.cpp.

104 {
105 return fTargetType.isLiteral();
106 }
virtual bool isLiteral() const
Definition: SkSLType.h:516

◆ isMatrix()

bool SkSL::AliasType::isMatrix ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 112 of file SkSLType.cpp.

112 {
113 return fTargetType.isMatrix();
114 }
virtual bool isMatrix() const
Definition: SkSLType.h:528

◆ isMultisampled()

bool SkSL::AliasType::isMultisampled ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 132 of file SkSLType.cpp.

132 {
133 return fTargetType.isMultisampled();
134 }
virtual bool isMultisampled() const
Definition: SkSLType.h:556

◆ isScalar()

bool SkSL::AliasType::isScalar ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 100 of file SkSLType.cpp.

100 {
101 return fTargetType.isScalar();
102 }
virtual bool isScalar() const
Definition: SkSLType.h:512

◆ isStruct()

bool SkSL::AliasType::isStruct ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 124 of file SkSLType.cpp.

124 {
125 return fTargetType.isStruct();
126 }
virtual bool isStruct() const
Definition: SkSLType.h:540

◆ isUnsizedArray()

bool SkSL::AliasType::isUnsizedArray ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 120 of file SkSLType.cpp.

120 {
121 return fTargetType.isUnsizedArray();
122 }
virtual bool isUnsizedArray() const
Definition: SkSLType.h:536

◆ isVector()

bool SkSL::AliasType::isVector ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 108 of file SkSLType.cpp.

108 {
109 return fTargetType.isVector();
110 }
virtual bool isVector() const
Definition: SkSLType.h:524

◆ numberKind()

NumberKind SkSL::AliasType::numberKind ( ) const
inlineoverridevirtual

Returns the NumberKind of this type (always kNonnumeric for non-scalar values).

Reimplemented from SkSL::Type.

Definition at line 56 of file SkSLType.cpp.

56 {
57 return fTargetType.numberKind();
58 }
virtual NumberKind numberKind() const
Definition: SkSLType.h:290

◆ priority()

int SkSL::AliasType::priority ( ) const
inlineoverridevirtual

Returns the "priority" of a number type, in order of float > half > int > short. When operating on two number types, the result is the higher-priority type.

Reimplemented from SkSL::Type.

Definition at line 60 of file SkSLType.cpp.

60 {
61 return fTargetType.priority();
62 }
virtual int priority() const
Definition: SkSLType.h:379

◆ resolve()

const Type & SkSL::AliasType::resolve ( ) const
inlineoverridevirtual

If this is an alias, returns the underlying type, otherwise returns this.

Reimplemented from SkSL::Type.

Definition at line 48 of file SkSLType.cpp.

48 {
49 return fTargetType;
50 }

◆ rows()

int SkSL::AliasType::rows ( ) const
inlineoverridevirtual

For matrices, returns the number of rows (e.g. mat2x4 returns 4). For vectors and scalars, returns 1. For all other types, causes an assertion failure.

Reimplemented from SkSL::Type.

Definition at line 68 of file SkSLType.cpp.

68 {
69 return fTargetType.rows();
70 }
virtual int rows() const
Definition: SkSLType.h:438

◆ slotCount()

size_t SkSL::AliasType::slotCount ( ) const
inlineoverridevirtual

Returns the number of scalars needed to hold this type.

Reimplemented from SkSL::Type.

Definition at line 80 of file SkSLType.cpp.

80 {
81 return fTargetType.slotCount();
82 }
virtual size_t slotCount() const
Definition: SkSLType.h:457

◆ slotType()

const Type & SkSL::AliasType::slotType ( size_t  ) const
inlineoverridevirtual

Returns the type of the value in the nth slot. For scalar, vector and matrix types, should always match componentType().

Reimplemented from SkSL::Type.

Definition at line 84 of file SkSLType.cpp.

84 {
85 return fTargetType.slotType(n);
86 }
virtual const Type & slotType(size_t) const
Definition: SkSLType.h:465

◆ textureAccess()

TextureAccess SkSL::AliasType::textureAccess ( ) const
inlineoverridevirtual

Reimplemented from SkSL::Type.

Definition at line 136 of file SkSLType.cpp.

136 {
137 return fTargetType.textureAccess();
138 }
virtual TextureAccess textureAccess() const
Definition: SkSLType.h:561

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