Flutter Engine
The Flutter Engine
Public Member Functions | Protected Types | Protected Member Functions | Friends | List of all members
GrGLSLVertexGeoBuilder Class Reference

#include <GrGLSLVertexGeoBuilder.h>

Inheritance diagram for GrGLSLVertexGeoBuilder:
GrGLSLShaderBuilder GrGLSLVertexBuilder

Public Member Functions

void insertFunction (const char *functionDefinition)
 
SkStringfunctions ()
 
this code ().appendVAList(format
 
this code ().prependVAList(format
 
SkStringcode ()
 
- 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 ()
 

Protected Types

using INHERITED = GrGLSLShaderBuilder
 
- 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

 GrGLSLVertexGeoBuilder (GrGLSLProgramBuilder *program)
 
void emitNormalizedSkPosition (const char *devPos, SkSLType devPosType=SkSLType::kFloat2)
 
void emitNormalizedSkPosition (SkString *out, const char *devPos, SkSLType devPosType=SkSLType::kFloat2)
 
- 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
 

Friends

class GrGeometryProcessor::ProgramImpl
 

Additional Inherited Members

- Public Types inherited from GrGLSLShaderBuilder
using SamplerHandle = GrGLSLUniformHandler::SamplerHandle
 
- Public Attributes inherited from GrGLSLShaderBuilder
void va_list args
 
this args
 
 n
 
- 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

Base class for vertex shader builder. This is the stage that computes input geometry for the rasterizer.

Definition at line 22 of file GrGLSLVertexGeoBuilder.h.

Member Typedef Documentation

◆ INHERITED

Definition at line 45 of file GrGLSLVertexGeoBuilder.h.

Constructor & Destructor Documentation

◆ GrGLSLVertexGeoBuilder()

GrGLSLVertexGeoBuilder::GrGLSLVertexGeoBuilder ( GrGLSLProgramBuilder program)
inlineprotected

Definition at line 34 of file GrGLSLVertexGeoBuilder.h.

34: INHERITED(program) {}
GrGLSLShaderBuilder INHERITED

Member Function Documentation

◆ code() [1/3]

SkString & GrGLSLShaderBuilder::code ( )
inline

Definition at line 248 of file GrGLSLShaderBuilder.h.

248{ return fShaderStrings[fCodeIndex]; }
skia_private::STArray< kPrealloc, SkString > fShaderStrings

◆ code() [2/3]

this GrGLSLShaderBuilder::code ( )

◆ code() [3/3]

this GrGLSLShaderBuilder::code ( )

◆ emitNormalizedSkPosition() [1/2]

void GrGLSLVertexGeoBuilder::emitNormalizedSkPosition ( const char *  devPos,
SkSLType  devPosType = SkSLType::kFloat2 
)
inlineprotected

Definition at line 36 of file GrGLSLVertexGeoBuilder.h.

36 {
37 this->emitNormalizedSkPosition(&this->code(), devPos, devPosType);
38 }
void emitNormalizedSkPosition(const char *devPos, SkSLType devPosType=SkSLType::kFloat2)
this code().appendVAList(format

◆ emitNormalizedSkPosition() [2/2]

void GrGLSLVertexGeoBuilder::emitNormalizedSkPosition ( SkString out,
const char *  devPos,
SkSLType  devPosType = SkSLType::kFloat2 
)
protected

Definition at line 14 of file GrGLSLVertexGeoBuilder.cpp.

15 {
16 if (this->getProgramBuilder()->snapVerticesToPixelCenters()) {
17 if (SkSLType::kFloat3 == devPosType) {
18 const char* p = devPos;
19 out->appendf("{float2 _posTmp = %s.xy / %s.z;", p, p);
20 } else {
21 SkASSERT(SkSLType::kFloat2 == devPosType);
22 out->appendf("{float2 _posTmp = %s;", devPos);
23 }
24 out->appendf("_posTmp = floor(_posTmp) + float2(0.5);"
25 "sk_Position = _posTmp.xy01;}");
26 } else if (SkSLType::kFloat3 == devPosType) {
27 out->appendf("sk_Position = %s.xy0z;", devPos);
28 } else {
29 SkASSERT(SkSLType::kFloat2 == devPosType);
30 out->appendf("sk_Position = %s.xy01;", devPos);
31 }
32}
#define SkASSERT(cond)
Definition: SkAssert.h:116
GrGLSLProgramBuilder * getProgramBuilder()

◆ functions()

SkString & GrGLSLShaderBuilder::functions ( )
inline

Definition at line 246 of file GrGLSLShaderBuilder.h.

◆ insertFunction()

void GrGLSLVertexGeoBuilder::insertFunction ( const char *  functionDefinition)
inline

Definition at line 27 of file GrGLSLVertexGeoBuilder.h.

27 {
28 this->functions().append(functionDefinition);
29 }
void append(const char text[])
Definition: SkString.h:203

Friends And Related Function Documentation

◆ GrGeometryProcessor::ProgramImpl

friend class GrGeometryProcessor::ProgramImpl
friend

Definition at line 43 of file GrGLSLVertexGeoBuilder.h.


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