Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 37 of file GrGLSLVarying.h.

Member Enumeration Documentation

◆ Scope

enum class GrGLSLVarying::Scope
strong
Enumerator
kVertToFrag 
kVertToGeo 
kGeoToFrag 

Definition at line 39 of file GrGLSLVarying.h.

Constructor & Destructor Documentation

◆ GrGLSLVarying() [1/2]

GrGLSLVarying::GrGLSLVarying ( )
default

◆ GrGLSLVarying() [2/2]

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

Definition at line 46 of file GrGLSLVarying.h.

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

Member Function Documentation

◆ fsIn()

const char * GrGLSLVarying::fsIn ( ) const
inline

Definition at line 67 of file GrGLSLVarying.h.

67{ SkASSERT(this->isInFragmentShader()); return fFsIn; }
bool isInFragmentShader() const

◆ fsInVar()

GrShaderVar GrGLSLVarying::fsInVar ( ) const
inline

Definition at line 74 of file GrGLSLVarying.h.

74 {
76 return GrShaderVar(this->fsIn(), fType, GrShaderVar::TypeModifier::In);
77 }
const char * fsIn() const

◆ isInFragmentShader()

bool GrGLSLVarying::isInFragmentShader ( ) const
inline

Definition at line 64 of file GrGLSLVarying.h.

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

◆ isInVertexShader()

bool GrGLSLVarying::isInVertexShader ( ) const
inline

Definition at line 63 of file GrGLSLVarying.h.

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

◆ reset()

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

Definition at line 53 of file GrGLSLVarying.h.

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

◆ scope()

Scope GrGLSLVarying::scope ( ) const
inline

Definition at line 62 of file GrGLSLVarying.h.

62{ return fScope; }

◆ type()

SkSLType GrGLSLVarying::type ( ) const
inline

Definition at line 61 of file GrGLSLVarying.h.

61{ return fType; }

◆ vsOut()

const char * GrGLSLVarying::vsOut ( ) const
inline

Definition at line 66 of file GrGLSLVarying.h.

66{ SkASSERT(this->isInVertexShader()); return fVsOut; }
bool isInVertexShader() const

◆ vsOutVar()

GrShaderVar GrGLSLVarying::vsOutVar ( ) const
inline

Definition at line 69 of file GrGLSLVarying.h.

69 {
71 return GrShaderVar(this->vsOut(), fType, GrShaderVar::TypeModifier::Out);
72 }
const char * vsOut() const

Friends And Related Symbol Documentation

◆ GrGLSLVaryingHandler

friend class GrGLSLVaryingHandler
friend

Definition at line 85 of file GrGLSLVarying.h.


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