Flutter Engine
The Flutter Engine
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SkSL::CodeGenerator Class Referenceabstract

#include <SkSLCodeGenerator.h>

Inheritance diagram for SkSL::CodeGenerator:
SkSL::GLSLCodeGenerator SkSL::MetalCodeGenerator SkSL::SPIRVCodeGenerator SkSL::WGSLCodeGenerator

Public Member Functions

 CodeGenerator (const Context *context, const ShaderCaps *caps, const Program *program, OutputStream *stream)
 
virtual ~CodeGenerator ()=default
 
virtual bool generateCode ()=0
 
OutputStreamoutputStream ()
 
void setOutputStream (OutputStream *output)
 

Protected Attributes

const ProgramfProgram
 
Context fContext
 
const ShaderCapsfCaps
 
OutputStreamfOut
 

Static Protected Attributes

static constexpr float kSharpenTexturesBias = -.475f
 

Detailed Description

Abstract superclass of all code generators, which take a Program as input and produce code as output.

Definition at line 23 of file SkSLCodeGenerator.h.

Constructor & Destructor Documentation

◆ CodeGenerator()

SkSL::CodeGenerator::CodeGenerator ( const Context context,
const ShaderCaps caps,
const Program program,
OutputStream stream 
)
inline

Definition at line 25 of file SkSLCodeGenerator.h.

29 : fProgram(*program)
30 , fContext(fProgram.fContext->fTypes, *fProgram.fContext->fErrors)
31 , fCaps(*caps)
32 , fOut(stream) {
36 }
const ShaderCaps & fCaps
const Program & fProgram
const Module * fModule
Definition: SkSLContext.h:44
SymbolTable * fSymbolTable
Definition: SkSLContext.h:48
ProgramConfig * fConfig
Definition: SkSLContext.h:33
std::shared_ptr< Context > fContext
Definition: SkSLProgram.h:154
std::unique_ptr< SymbolTable > fSymbols
Definition: SkSLProgram.h:158
std::unique_ptr< ProgramConfig > fConfig
Definition: SkSLProgram.h:153

◆ ~CodeGenerator()

virtual SkSL::CodeGenerator::~CodeGenerator ( )
virtualdefault

Member Function Documentation

◆ generateCode()

virtual bool SkSL::CodeGenerator::generateCode ( )
pure virtual

◆ outputStream()

OutputStream * SkSL::CodeGenerator::outputStream ( )
inline

Definition at line 43 of file SkSLCodeGenerator.h.

43{ return fOut; }

◆ setOutputStream()

void SkSL::CodeGenerator::setOutputStream ( OutputStream output)
inline

Definition at line 44 of file SkSLCodeGenerator.h.

Member Data Documentation

◆ fCaps

const ShaderCaps& SkSL::CodeGenerator::fCaps
protected

Definition at line 64 of file SkSLCodeGenerator.h.

◆ fContext

Context SkSL::CodeGenerator::fContext
protected

Definition at line 63 of file SkSLCodeGenerator.h.

◆ fOut

OutputStream* SkSL::CodeGenerator::fOut
protected

Definition at line 65 of file SkSLCodeGenerator.h.

◆ fProgram

const Program& SkSL::CodeGenerator::fProgram
protected

Definition at line 62 of file SkSLCodeGenerator.h.

◆ kSharpenTexturesBias

constexpr float SkSL::CodeGenerator::kSharpenTexturesBias = -.475f
staticconstexprprotected

Definition at line 59 of file SkSLCodeGenerator.h.


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