Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | List of all members
GrGLSLFPFragmentBuilder Class Referenceabstract

#include <GrGLSLFragmentShaderBuilder.h>

Inheritance diagram for GrGLSLFPFragmentBuilder:
GrGLSLShaderBuilder GrGLSLFragmentShaderBuilder

Public Types

enum class  ScopeFlags { kTopLevel = 0 , kInsidePerPrimitiveBranch = (1 << 0) , kInsidePerPixelBranch = (1 << 1) , kInsideLoop = (1 << 2) }
 
- Public Types inherited from GrGLSLShaderBuilder
using SamplerHandle = GrGLSLUniformHandler::SamplerHandle
 

Public Member Functions

 GrGLSLFPFragmentBuilder ()
 
virtual void forceHighPrecision ()=0
 
virtual const char * dstColor ()=0
 
- Public Member Functions inherited from GrGLSLShaderBuilder
 GrGLSLShaderBuilder (GrGLSLProgramBuilder *program)
 
virtual ~GrGLSLShaderBuilder ()
 
void appendTextureLookup (SkString *out, SamplerHandle, const char *coordName) const
 
void appendTextureLookup (SamplerHandle, const char *coordName, GrGLSLColorSpaceXformHelper *colorXformHelper=nullptr)
 
void appendTextureLookupAndBlend (const char *dst, SkBlendMode, SamplerHandle, const char *coordName, GrGLSLColorSpaceXformHelper *colorXformHelper=nullptr)
 
void appendInputLoad (SamplerHandle)
 
void appendColorGamutXform (SkString *out, const char *srcColor, GrGLSLColorSpaceXformHelper *colorXformHelper)
 
void appendColorGamutXform (const char *srcColor, GrGLSLColorSpaceXformHelper *colorXformHelper)
 
void defineConstant (const char *type, const char *name, const char *value)
 
void defineConstant (const char *name, int value)
 
void defineConstant (const char *name, float value)
 
void defineConstantf (const char *type, const char *name, const char *fmt,...) SK_PRINTF_LIKE(4
 
 va_start (args, fmt)
 
this definitions ().appendVAList(fmt
 
 va_end (args)
 
this definitions ().append("
 
void definitionAppend (const char *str)
 
void declareGlobal (const GrShaderVar &)
 
SkString newTmpVarName (const char *suffix)
 
void codeAppendf (const char format[],...) SK_PRINTF_LIKE(2
 
void va_start (args, format)
 
this code ().appendVAList(format
 
 va_end (args)
 
void codeAppend (const char *str)
 
void codeAppend (const char *str, size_t length)
 
void codePrependf (const char format[],...) SK_PRINTF_LIKE(2
 
void va_start (args, format)
 
this code ().prependVAList(format
 
 va_end (args)
 
void declAppend (const GrShaderVar &var)
 
SkString getMangledFunctionName (const char *baseName)
 
void emitFunctionPrototype (SkSLType returnType, const char *mangledName, SkSpan< const GrShaderVar > args)
 
void emitFunctionPrototype (const char *declaration)
 
void emitFunction (SkSLType returnType, const char *mangledName, SkSpan< const GrShaderVar > args, const char *body)
 
void emitFunction (const char *declaration, const char *body)
 
void finalize (uint32_t visibility)
 
GrGLSLProgramBuildergetProgramBuilder ()
 

Additional Inherited Members

- Public Attributes inherited from GrGLSLShaderBuilder
void va_list args
 
this args
 
 n
 
- Protected Types inherited from GrGLSLShaderBuilder
enum  GLSLPrivateFeature {
  kFragCoordConventions_GLSLPrivateFeature , kBlendEquationAdvanced_GLSLPrivateFeature , kBlendFuncExtended_GLSLPrivateFeature , kFramebufferFetch_GLSLPrivateFeature ,
  kNoPerspectiveInterpolation_GLSLPrivateFeature , kSampleVariables_GLSLPrivateFeature , kLastGLSLPrivateFeature = kSampleVariables_GLSLPrivateFeature
}
 
enum  InterfaceQualifier { kIn_InterfaceQualifier , kOut_InterfaceQualifier , kLastInterfaceQualifier = kOut_InterfaceQualifier }
 
enum  {
  kExtensions , kDefinitions , kPrecisionQualifier , kLayoutQualifiers ,
  kUniforms , kInputs , kOutputs , kFunctions ,
  kMain , kCode , kPrealloc = kCode + 6
}
 
typedef SkTBlockList< GrShaderVarVarArray
 
- Protected Member Functions inherited from GrGLSLShaderBuilder
void appendDecls (const VarArray &vars, SkString *out) const
 
void appendFunctionDecl (SkSLType returnType, const char *mangledName, SkSpan< const GrShaderVar > args)
 
bool addFeature (uint32_t featureBit, const char *extensionName)
 
void addLayoutQualifier (const char *param, InterfaceQualifier)
 
void compileAndAppendLayoutQualifiers ()
 
void nextStage ()
 
void deleteStage ()
 
SkStringextensions ()
 
SkStringdefinitions ()
 
SkStringprecisionQualifier ()
 
SkStringlayoutQualifiers ()
 
SkStringuniforms ()
 
SkStringinputs ()
 
SkStringoutputs ()
 
SkStringfunctions ()
 
SkStringmain ()
 
SkStringcode ()
 
virtual void onFinalize ()=0
 
- Protected Attributes inherited from GrGLSLShaderBuilder
GrGLSLProgramBuilderfProgramBuilder
 
std::string fCompilerString
 
skia_private::STArray< kPrealloc, SkStringfShaderStrings
 
SkString fCode
 
SkString fFunctions
 
SkString fExtensions
 
SkSL::StatementArray fDeclarations
 
VarArray fInputs
 
VarArray fOutputs
 
uint32_t fFeaturesAddedMask
 
skia_private::STArray< 1, SkStringfLayoutParams [kLastInterfaceQualifier+1]
 
int fCodeIndex
 
bool fFinalized
 
int fTmpVariableCounter
 

Detailed Description

Definition at line 24 of file GrGLSLFragmentShaderBuilder.h.

Member Enumeration Documentation

◆ ScopeFlags

Enumerator
kTopLevel 
kInsidePerPrimitiveBranch 
kInsidePerPixelBranch 
kInsideLoop 

Definition at line 32 of file GrGLSLFragmentShaderBuilder.h.

32 {
33 // Every fragment will always execute this code, and will do it exactly once.
34 kTopLevel = 0,
35 // Either all fragments in a given primitive, or none, will execute this code.
36 kInsidePerPrimitiveBranch = (1 << 0),
37 // Any given fragment may or may not execute this code.
38 kInsidePerPixelBranch = (1 << 1),
39 // This code will be executed more than once.
40 kInsideLoop = (1 << 2)
41 };

Constructor & Destructor Documentation

◆ GrGLSLFPFragmentBuilder()

GrGLSLFPFragmentBuilder::GrGLSLFPFragmentBuilder ( )
inline

Appease the compiler; the derived class initializes GrGLSLShaderBuilder.

Definition at line 27 of file GrGLSLFragmentShaderBuilder.h.

27 : GrGLSLShaderBuilder(nullptr) {
28 // Suppress unused warning error
29 (void) fPadding;
30 }
GrGLSLShaderBuilder(GrGLSLProgramBuilder *program)

Member Function Documentation

◆ dstColor()

virtual const char * GrGLSLFPFragmentBuilder::dstColor ( )
pure virtual

Returns the variable name that holds the color of the destination pixel. This may be nullptr if no effect advertised that it will read the destination.

Implemented in GrGLSLFragmentShaderBuilder.

◆ forceHighPrecision()

virtual void GrGLSLFPFragmentBuilder::forceHighPrecision ( )
pure virtual

Implemented in GrGLSLFragmentShaderBuilder.


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