Flutter Engine
The Flutter Engine
|
#include <SkSLCompiler.h>
Public Types | |
enum class | OverrideFlag { kDefault , kOff , kOn } |
Public Member Functions | |
Compiler () | |
~Compiler () | |
Compiler (const Compiler &)=delete | |
Compiler & | operator= (const Compiler &)=delete |
std::unique_ptr< Program > | convertProgram (ProgramKind kind, std::string programSource, const ProgramSettings &settings) |
void | handleError (std::string_view msg, Position pos) |
std::string | errorText (bool showCount=true) |
ErrorReporter & | errorReporter () |
int | errorCount () const |
void | writeErrorCount () |
void | resetErrors () |
Context & | context () const |
SymbolTable * | globalSymbols () |
SymbolTable * | symbolTable () |
std::unique_ptr< Module > | compileModule (ProgramKind kind, const char *moduleName, std::string moduleSource, const Module *parentModule, bool shouldInline) |
bool | optimizeModuleBeforeMinifying (ProgramKind kind, Module &module, bool shrinkSymbols) |
const Module * | moduleForProgramKind (ProgramKind kind) |
void | runInliner (Program &program) |
Static Public Member Functions | |
static std::array< float, 4 > | GetRTAdjustVector (SkISize rtDims, bool flipY) |
static std::array< float, 2 > | GetRTFlipVector (int rtHeight, bool flipY) |
static void | EnableOptimizer (OverrideFlag flag) |
static void | EnableInliner (OverrideFlag flag) |
Static Public Attributes | |
static constexpr const char | FRAGCOLOR_NAME [] = "sk_FragColor" |
static constexpr const char | RTADJUST_NAME [] = "sk_RTAdjust" |
static constexpr const char | POSITION_NAME [] = "sk_Position" |
static constexpr const char | POISON_TAG [] = "<POISON>" |
Friends | |
class | Parser |
class | ThreadContext |
Main compiler entry point. The compiler parses the SkSL text directly into a tree of IRNodes, while performing basic optimizations such as constant-folding and dead-code elimination. Then the Program is passed into a CodeGenerator to produce compiled output.
See the README for information about SkSL.
Definition at line 69 of file SkSLCompiler.h.
|
strong |
Allows optimization settings to be unilaterally overridden. This is meant to allow tools like Viewer or Nanobench to override the compiler's ProgramSettings and ShaderCaps for debugging.
Enumerator | |
---|---|
kDefault | |
kOff | |
kOn |
Definition at line 116 of file SkSLCompiler.h.
SkSL::Compiler::Compiler | ( | ) |
Definition at line 56 of file SkSLCompiler.cpp.
SkSL::Compiler::~Compiler | ( | ) |
Definition at line 61 of file SkSLCompiler.cpp.
|
delete |
std::unique_ptr< Module > SkSL::Compiler::compileModule | ( | ProgramKind | kind, |
const char * | moduleName, | ||
std::string | moduleSource, | ||
const Module * | parentModule, | ||
bool | shouldInline | ||
) |
Definition at line 175 of file SkSLCompiler.cpp.
|
inline |
Definition at line 143 of file SkSLCompiler.h.
std::unique_ptr< Program > SkSL::Compiler::convertProgram | ( | ProgramKind | kind, |
std::string | programSource, | ||
const ProgramSettings & | settings | ||
) |
Definition at line 207 of file SkSLCompiler.cpp.
|
inlinestatic |
Definition at line 122 of file SkSLCompiler.h.
|
inlinestatic |
Definition at line 121 of file SkSLCompiler.h.
|
inline |
Definition at line 134 of file SkSLCompiler.h.
|
inline |
Definition at line 132 of file SkSLCompiler.h.
std::string SkSL::Compiler::errorText | ( | bool | showCount = true | ) |
Definition at line 512 of file SkSLCompiler.cpp.
|
inlinestatic |
Gets a float4 that adjusts the position from Skia device coords to normalized device coords, used to populate sk_RTAdjust. Assuming the transformed position, pos, is a homogeneous float4, the vec, v, is applied as such: float4((pos.xy * v.xz) + sk_Position.ww * v.yw, 0, pos.w);
Definition at line 82 of file SkSLCompiler.h.
|
inlinestatic |
|
inline |
Definition at line 147 of file SkSLCompiler.h.
void SkSL::Compiler::handleError | ( | std::string_view | msg, |
Position | pos | ||
) |
Definition at line 433 of file SkSLCompiler.cpp.
const Module * SkSL::Compiler::moduleForProgramKind | ( | ProgramKind | kind | ) |
Definition at line 63 of file SkSLCompiler.cpp.
bool SkSL::Compiler::optimizeModuleBeforeMinifying | ( | ProgramKind | kind, |
Module & | module, | ||
bool | shrinkSymbols | ||
) |
Optimize a module at minification time, before writing it out.
Definition at line 247 of file SkSLCompiler.cpp.
|
inline |
Definition at line 138 of file SkSLCompiler.h.
void SkSL::Compiler::runInliner | ( | Program & | program | ) |
Run the inliner on a program which was compiled earlier (with inlining turned off).
Definition at line 370 of file SkSLCompiler.cpp.
|
inline |
Definition at line 151 of file SkSLCompiler.h.
void SkSL::Compiler::writeErrorCount | ( | ) |
Definition at line 521 of file SkSLCompiler.cpp.
|
friend |
Definition at line 230 of file SkSLCompiler.h.
|
friend |
Definition at line 231 of file SkSLCompiler.h.
|
inlinestaticconstexpr |
Definition at line 71 of file SkSLCompiler.h.
|
inlinestaticconstexpr |
Definition at line 74 of file SkSLCompiler.h.
|
inlinestaticconstexpr |
Definition at line 73 of file SkSLCompiler.h.
|
inlinestaticconstexpr |
Definition at line 72 of file SkSLCompiler.h.