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

#include <GrGLSLVarying.h>

Public Types

enum class  Scope { kVertToFrag , kVertToGeo , kGeoToFrag }
 

Public Member Functions

 GrGLSLVarying ()=default
 
 GrGLSLVarying (SkSLType type, Scope scope=Scope::kVertToFrag)
 
void reset (SkSLType type, Scope scope=Scope::kVertToFrag)
 
SkSLType type () const
 
Scope scope () const
 
bool isInVertexShader () const
 
bool isInFragmentShader () const
 
const char * vsOut () const
 
const char * fsIn () const
 
GrShaderVar vsOutVar () const
 
GrShaderVar fsInVar () const
 

Friends

class GrGLSLVaryingHandler
 

Detailed Description

Definition at line 38 of file GrGLSLVarying.h.

Member Enumeration Documentation

◆ Scope

enum class GrGLSLVarying::Scope
strong
Enumerator
kVertToFrag 
kVertToGeo 
kGeoToFrag 

Definition at line 40 of file GrGLSLVarying.h.

40 {
41 kVertToFrag,
42 kVertToGeo,
43 kGeoToFrag
44 };

Constructor & Destructor Documentation

◆ GrGLSLVarying() [1/2]

GrGLSLVarying::GrGLSLVarying ( )
default

◆ GrGLSLVarying() [2/2]

GrGLSLVarying::GrGLSLVarying ( SkSLType  type,
Scope  scope = Scope::kVertToFrag 
)
inline

Definition at line 47 of file GrGLSLVarying.h.

48 : fType(type)
49 , fScope(scope) {
50 // Metal doesn't support varying matrices, so we disallow them everywhere for consistency
51 SkASSERT(!is_matrix(type));
52 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
Scope scope() const
Definition: GrGLSLVarying.h:63
SkSLType type() const
Definition: GrGLSLVarying.h:62

Member Function Documentation

◆ fsIn()

const char * GrGLSLVarying::fsIn ( ) const
inline

Definition at line 68 of file GrGLSLVarying.h.

68{ SkASSERT(this->isInFragmentShader()); return fFsIn; }
bool isInFragmentShader() const
Definition: GrGLSLVarying.h:65

◆ fsInVar()

GrShaderVar GrGLSLVarying::fsInVar ( ) const
inline

Definition at line 75 of file GrGLSLVarying.h.

75 {
77 return GrShaderVar(this->fsIn(), fType, GrShaderVar::TypeModifier::In);
78 }
const char * fsIn() const
Definition: GrGLSLVarying.h:68

◆ isInFragmentShader()

bool GrGLSLVarying::isInFragmentShader ( ) const
inline

Definition at line 65 of file GrGLSLVarying.h.

65{ return Scope::kVertToGeo != fScope; }

◆ isInVertexShader()

bool GrGLSLVarying::isInVertexShader ( ) const
inline

Definition at line 64 of file GrGLSLVarying.h.

64{ return Scope::kGeoToFrag != fScope; }

◆ reset()

void GrGLSLVarying::reset ( SkSLType  type,
Scope  scope = Scope::kVertToFrag 
)
inline

Definition at line 54 of file GrGLSLVarying.h.

54 {
55 // Metal doesn't support varying matrices, so we disallow them everywhere for consistency
56 SkASSERT(!is_matrix(type));
57 *this = GrGLSLVarying();
58 fType = type;
59 fScope = scope;
60 }
GrGLSLVarying()=default

◆ scope()

Scope GrGLSLVarying::scope ( ) const
inline

Definition at line 63 of file GrGLSLVarying.h.

63{ return fScope; }

◆ type()

SkSLType GrGLSLVarying::type ( ) const
inline

Definition at line 62 of file GrGLSLVarying.h.

62{ return fType; }

◆ vsOut()

const char * GrGLSLVarying::vsOut ( ) const
inline

Definition at line 67 of file GrGLSLVarying.h.

67{ SkASSERT(this->isInVertexShader()); return fVsOut; }
bool isInVertexShader() const
Definition: GrGLSLVarying.h:64

◆ vsOutVar()

GrShaderVar GrGLSLVarying::vsOutVar ( ) const
inline

Definition at line 70 of file GrGLSLVarying.h.

70 {
72 return GrShaderVar(this->vsOut(), fType, GrShaderVar::TypeModifier::Out);
73 }
const char * vsOut() const
Definition: GrGLSLVarying.h:67

Friends And Related Function Documentation

◆ GrGLSLVaryingHandler

friend class GrGLSLVaryingHandler
friend

Definition at line 86 of file GrGLSLVarying.h.


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