Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::graphite::ShaderNode Class Reference

#include <ShaderCodeDictionary.h>

Public Member Functions

 ShaderNode (const ShaderSnippet *snippet, SkSpan< const ShaderNode * > children, int codeID, int keyIndex, SkSpan< const uint32_t > data)
 
int32_t codeSnippetId () const
 
int32_t keyIndex () const
 
const ShaderSnippetentry () const
 
SkEnumBitMask< SnippetRequirementFlagsrequiredFlags () const
 
int numChildren () const
 
SkSpan< const ShaderNode * > children () const
 
const ShaderNodechild (int childIndex) const
 
SkSpan< const uint32_t > data () const
 

Detailed Description

Definition at line 134 of file ShaderCodeDictionary.h.

Constructor & Destructor Documentation

◆ ShaderNode()

skgpu::graphite::ShaderNode::ShaderNode ( const ShaderSnippet snippet,
SkSpan< const ShaderNode * >  children,
int  codeID,
int  keyIndex,
SkSpan< const uint32_t >  data 
)
inline

Definition at line 137 of file ShaderCodeDictionary.h.

142 : fEntry(snippet)
143 , fChildren(children)
144 , fCodeID(codeID)
145 , fKeyIndex(keyIndex)
146 , fRequiredFlags(snippet->fSnippetRequirementFlags)
147 , fData(data) {
148 SkASSERT(children.size() == (size_t) fEntry->fNumChildren);
149 // TODO: RuntimeEffects can actually mask off requirements if they invoke a child with
150 // explicit arguments.
151 for (const ShaderNode* child : children) {
152 fRequiredFlags |= child->requiredFlags();
153 }
154 // Data should only be provided if the snippet has the kStoresData flag.
155 SkASSERT(fData.empty() || snippet->storesData());
156 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
constexpr bool empty() const
Definition: SkSpan_impl.h:96
ShaderNode(const ShaderSnippet *snippet, SkSpan< const ShaderNode * > children, int codeID, int keyIndex, SkSpan< const uint32_t > data)
const ShaderNode * child(int childIndex) const
SkSpan< const ShaderNode * > children() const
SkEnumBitMask< SnippetRequirementFlags > requiredFlags() const
SkSpan< const uint32_t > data() const

Member Function Documentation

◆ child()

const ShaderNode * skgpu::graphite::ShaderNode::child ( int  childIndex) const
inline

Definition at line 166 of file ShaderCodeDictionary.h.

166{ return fChildren[childIndex]; }

◆ children()

SkSpan< const ShaderNode * > skgpu::graphite::ShaderNode::children ( ) const
inline

Definition at line 165 of file ShaderCodeDictionary.h.

165{ return fChildren; }

◆ codeSnippetId()

int32_t skgpu::graphite::ShaderNode::codeSnippetId ( ) const
inline

Definition at line 158 of file ShaderCodeDictionary.h.

158{ return fCodeID; }

◆ data()

SkSpan< const uint32_t > skgpu::graphite::ShaderNode::data ( ) const
inline

Definition at line 168 of file ShaderCodeDictionary.h.

168{ return fData; }

◆ entry()

const ShaderSnippet * skgpu::graphite::ShaderNode::entry ( ) const
inline

Definition at line 160 of file ShaderCodeDictionary.h.

160{ return fEntry; }

◆ keyIndex()

int32_t skgpu::graphite::ShaderNode::keyIndex ( ) const
inline

Definition at line 159 of file ShaderCodeDictionary.h.

159{ return fKeyIndex; }

◆ numChildren()

int skgpu::graphite::ShaderNode::numChildren ( ) const
inline

Definition at line 164 of file ShaderCodeDictionary.h.

164{ return fEntry->fNumChildren; }

◆ requiredFlags()

SkEnumBitMask< SnippetRequirementFlags > skgpu::graphite::ShaderNode::requiredFlags ( ) const
inline

Definition at line 162 of file ShaderCodeDictionary.h.

162{ return fRequiredFlags; }

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