![]() |
Flutter Engine
The Flutter Engine
|
Classes | |
struct | TypedOps |
Public Types | |
using | ImmutableBits = int32_t |
Static Public Member Functions | |
static BuilderOp | GetTypedOp (const SkSL::Type &type, const TypedOps &ops) |
static bool | IsUniform (const Variable &var) |
static bool | IsOutParameter (const Variable &var) |
static bool | IsInoutParameter (const Variable &var) |
Friends | |
class | AutoContinueMask |
Definition at line 181 of file SkSLRasterPipelineCodeGenerator.cpp.
using SkSL::RP::Generator::ImmutableBits = int32_t |
Support methods for immutable data, which trade more slots for smaller code size.
Definition at line 345 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 183 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 195 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::binaryOp | ( | const SkSL::Type & | type, |
const TypedOps & | ops | ||
) |
Definition at line 2262 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
The Builder stitches our instructions together into Raster Pipeline code.
Definition at line 287 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::calculateLineOffsets | ( | ) |
Prepares our position-to-line-offset conversion table (stored in fLineOffsets
).
Definition at line 1572 of file SkSLRasterPipelineCodeGenerator.cpp.
int SkSL::RP::Generator::createStack | ( | ) |
Creates an additional stack for the program to push values onto. The stack will not become actively in-use until setCurrentStack
is called.
Definition at line 1358 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Reports the currently active stack.
Definition at line 270 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Pops an expression from the value stack and discards it.
Definition at line 371 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::discardTraceScopeMask | ( | ) |
Definition at line 1560 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::emitTraceLine | ( | Position | pos | ) |
Emits a trace_line opcode. writeStatement does this, and statements that alter control flow may need to explicitly add additional traces.
Definition at line 1535 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::emitTraceScope | ( | int | delta | ) |
Definition at line 1566 of file SkSLRasterPipelineCodeGenerator.cpp.
std::optional< SlotRange > SkSL::RP::Generator::findPreexistingImmutableData | ( | const TArray< ImmutableBits > & | immutableValues | ) |
Definition at line 2715 of file SkSLRasterPipelineCodeGenerator.cpp.
std::unique_ptr< RP::Program > SkSL::RP::Generator::finish | ( | ) |
Returns the generated program.
Definition at line 4061 of file SkSLRasterPipelineCodeGenerator.cpp.
Definition at line 2328 of file SkSLRasterPipelineCodeGenerator.cpp.
Definition at line 2280 of file SkSLRasterPipelineCodeGenerator.cpp.
int SkSL::RP::Generator::getFunctionDebugInfo | ( | const FunctionDeclaration & | decl | ) |
Returns the slot index of this function inside the FunctionDebugInfo array in DebugTracePriv. The FunctionDebugInfo slot will be created if it doesn't already exist.
Definition at line 1333 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Looks up the slots associated with an SkSL function's return value; creates the range if necessary. Note that recursion is never supported, so we don't need to maintain return values in a stack; we can just statically allocate one slot per function call-site.
Definition at line 253 of file SkSLRasterPipelineCodeGenerator.cpp.
std::optional< Generator::ImmutableBits > SkSL::RP::Generator::getImmutableBitsForSlot | ( | const Expression & | expr, |
size_t | slot | ||
) |
Definition at line 2657 of file SkSLRasterPipelineCodeGenerator.cpp.
Looks up the slots associated with an immutable variable; creates the slots if necessary.
Definition at line 235 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::getImmutableValueForExpression | ( | const Expression & | expr, |
TArray< ImmutableBits > * | immutableValues | ||
) |
Definition at line 2685 of file SkSLRasterPipelineCodeGenerator.cpp.
|
static |
Definition at line 2243 of file SkSLRasterPipelineCodeGenerator.cpp.
BuilderOp SkSL::RP::Generator::getTypedOp | ( | const SkSL::Type & | type, |
const TypedOps & | ops | ||
) | const |
Looks up the slots associated with an SkSL uniform; creates the slots if necessary.
Definition at line 242 of file SkSLRasterPipelineCodeGenerator.cpp.
Looks up the slots associated with an SkSL variable; creates the slots if necessary.
Definition at line 227 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Returns true for variables with slots in fProgramSlots; immutables or uniforms are false.
Definition at line 222 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inlinestatic |
Definition at line 470 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inlinestatic |
Definition at line 465 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inlinestatic |
Definition at line 461 of file SkSLRasterPipelineCodeGenerator.cpp.
std::unique_ptr< LValue > SkSL::RP::Generator::makeLValue | ( | const Expression & | e, |
bool | allowScratch = false |
||
) |
Returns an LValue for the passed-in expression; if the expression isn't supported as an LValue, returns nullptr.
Definition at line 1245 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 456 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 452 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Pops an expression from the value stack and copies it into slots.
Definition at line 357 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 363 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::push | ( | LValue & | lvalue | ) |
Pushes the lvalue onto the top-of-stack.
Definition at line 1318 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushAbsFloatIntrinsic | ( | int | slots | ) |
Definition at line 3048 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushBinaryExpression | ( | const BinaryExpression & | e | ) |
Pushes an expression to the value stack.
Definition at line 2416 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushBinaryExpression | ( | const Expression & | left, |
Operator | op, | ||
const Expression & | right | ||
) |
Definition at line 2420 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushChildCall | ( | const ChildCall & | c | ) |
Definition at line 2792 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushConstructorCast | ( | const AnyConstructor & | c | ) |
Definition at line 2860 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushConstructorCompound | ( | const AnyConstructor & | c | ) |
Definition at line 2780 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushConstructorDiagonalMatrix | ( | const ConstructorDiagonalMatrix & | c | ) |
Definition at line 2940 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushConstructorMatrixResize | ( | const ConstructorMatrixResize & | c | ) |
Definition at line 2953 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushConstructorSplat | ( | const ConstructorSplat & | c | ) |
Definition at line 2964 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushDynamicallyUniformTernaryExpression | ( | const Expression & | test, |
const Expression & | ifTrue, | ||
const Expression & | ifFalse | ||
) |
Definition at line 3768 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushExpression | ( | const Expression & | e, |
bool | usesResult = true |
||
) |
Definition at line 2181 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushFieldAccess | ( | const FieldAccess & | f | ) |
Definition at line 2972 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushFunctionCall | ( | const FunctionCall & | c | ) |
Definition at line 2978 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushImmutableData | ( | const Expression & | e | ) |
Definition at line 2761 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIndexExpression | ( | const IndexExpression & | i | ) |
Definition at line 3012 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | BuilderOp | builderOp, |
const Expression & | arg0 | ||
) |
Definition at line 3073 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | BuilderOp | builderOp, |
const Expression & | arg0, | ||
const Expression & | arg1 | ||
) |
Definition at line 3321 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | const FunctionCall & | c | ) |
Definition at line 3017 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | const TypedOps & | ops, |
const Expression & | arg0 | ||
) |
Definition at line 3066 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | const TypedOps & | ops, |
const Expression & | arg0, | ||
const Expression & | arg1 | ||
) |
Definition at line 3314 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | IntrinsicKind | intrinsic, |
const Expression & | arg0 | ||
) |
Definition at line 3081 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | IntrinsicKind | intrinsic, |
const Expression & | arg0, | ||
const Expression & | arg1 | ||
) |
Definition at line 3329 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushIntrinsic | ( | IntrinsicKind | intrinsic, |
const Expression & | arg0, | ||
const Expression & | arg1, | ||
const Expression & | arg2 | ||
) |
Definition at line 3494 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushLengthIntrinsic | ( | int | slotCount | ) |
Definition at line 3036 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushLiteral | ( | const Literal & | l | ) |
Definition at line 3616 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushLValueOrExpression | ( | LValue * | lvalue, |
const Expression & | expr | ||
) |
Definition at line 2298 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushMatrixMultiply | ( | LValue * | lvalue, |
const Expression & | left, | ||
const Expression & | right, | ||
int | leftColumns, | ||
int | leftRows, | ||
int | rightColumns, | ||
int | rightRows | ||
) |
Definition at line 2303 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushPostfixExpression | ( | const PostfixExpression & | p, |
bool | usesResult | ||
) |
Definition at line 3639 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushPrefixExpression | ( | const PrefixExpression & | p | ) |
Definition at line 3687 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushPrefixExpression | ( | Operator | op, |
const Expression & | expr | ||
) |
Definition at line 3691 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushStructuredComparison | ( | LValue * | left, |
Operator | op, | ||
LValue * | right, | ||
const Type & | type | ||
) |
Definition at line 2346 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushSwizzle | ( | const Swizzle & | s | ) |
Definition at line 3735 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushTernaryExpression | ( | const Expression & | test, |
const Expression & | ifTrue, | ||
const Expression & | ifFalse | ||
) |
Definition at line 3815 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushTernaryExpression | ( | const TernaryExpression & | t | ) |
Definition at line 3764 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::pushTraceScopeMask | ( | ) |
Emits a trace_scope opcode, which alters the SkSL variable-scope depth. Unlike the other trace ops, trace_scope takes a dedicated mask instead of the trace-scope mask. Call pushTraceScopeMask
to synthesize this mask; discard it when you're done.
Definition at line 1549 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushVariableReference | ( | const VariableReference & | v | ) |
Definition at line 3923 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushVariableReferencePartial | ( | const VariableReference & | v, |
SlotRange | subset | ||
) |
Definition at line 3937 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::pushVectorizedExpression | ( | const Expression & | expr, |
const Type & | vectorType | ||
) |
Definition at line 3055 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::recycleStack | ( | int | stackID | ) |
Frees a stack generated by createStack
. The freed stack must be completely empty.
Definition at line 1367 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 443 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::setCurrentStack | ( | int | stackID | ) |
Redirects builder ops to point to a different stack (created by createStack
).
Definition at line 1371 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 399 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::store | ( | LValue & | lvalue | ) |
Copies the top-of-stack value into this lvalue, without discarding it from the stack.
Definition at line 1325 of file SkSLRasterPipelineCodeGenerator.cpp.
void SkSL::RP::Generator::storeImmutableValueToSlots | ( | const TArray< ImmutableBits > & | immutableValues, |
SlotRange | slots | ||
) |
Definition at line 2702 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::ternaryOp | ( | const SkSL::Type & | type, |
const TypedOps & | ops | ||
) |
Definition at line 2271 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Definition at line 400 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::unaryOp | ( | const SkSL::Type & | type, |
const TypedOps & | ops | ||
) |
Definition at line 2253 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeBlock | ( | const Block & | b | ) |
Definition at line 1696 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeBreakStatement | ( | const BreakStatement & | b | ) |
Definition at line 1721 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeContinueStatement | ( | const ContinueStatement & | b | ) |
Definition at line 1729 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeDoStatement | ( | const DoStatement & | d | ) |
Definition at line 1734 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeDynamicallyUniformIfStatement | ( | const IfStatement & | i | ) |
Definition at line 1967 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeExpressionStatement | ( | const ExpressionStatement & | e | ) |
Definition at line 1959 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeForStatement | ( | const ForStatement & | f | ) |
Definition at line 1856 of file SkSLRasterPipelineCodeGenerator.cpp.
std::optional< SlotRange > SkSL::RP::Generator::writeFunction | ( | const IRNode & | callSite, |
const FunctionDefinition & | function, | ||
SkSpan< std::unique_ptr< Expression > const > | arguments | ||
) |
Converts an SkSL function into a set of Instructions. Returns nullopt if the function contained unsupported statements or expressions.
Definition at line 1378 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeGlobals | ( | ) |
Definition at line 1583 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeIfStatement | ( | const IfStatement & | i | ) |
Definition at line 2006 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeImmutableVarDeclaration | ( | const VarDeclaration & | d | ) |
Definition at line 2126 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeMasklessForStatement | ( | const ForStatement & | f | ) |
Definition at line 1788 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeProgram | ( | const FunctionDefinition & | function | ) |
Converts the SkSL main() function into a set of Instructions.
Definition at line 3975 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeReturnStatement | ( | const ReturnStatement & | r | ) |
Definition at line 2043 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeStatement | ( | const Statement & | s | ) |
Appends a statement to the program.
Definition at line 1641 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeSwitchStatement | ( | const SwitchStatement & | s | ) |
Definition at line 2058 of file SkSLRasterPipelineCodeGenerator.cpp.
bool SkSL::RP::Generator::writeVarDeclaration | ( | const VarDeclaration & | v | ) |
Definition at line 2164 of file SkSLRasterPipelineCodeGenerator.cpp.
|
inline |
Zeroes out a range of slots.
Definition at line 374 of file SkSLRasterPipelineCodeGenerator.cpp.
|
friend |
Definition at line 561 of file SkSLRasterPipelineCodeGenerator.cpp.