Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
skgpu::tess::AttribValue< A, T, Required, Optional > Struct Template Reference

#include <PatchWriter.h>

Public Types

using DataType = std::conditional_t< Required, T, std::conditional_t< Optional, std::pair< T, bool >, std::monostate > >
 

Public Member Functions

 AttribValue (PatchAttribs attribs)
 
 AttribValue (PatchAttribs attribs, const T &t)
 
AttribValueoperator= (const T &v)
 

Public Attributes

DataType fV
 

Static Public Attributes

static constexpr bool kEnabled = Required || Optional
 

Detailed Description

template<PatchAttribs A, typename T, bool Required, bool Optional>
struct skgpu::tess::AttribValue< A, T, Required, Optional >

Definition at line 134 of file PatchWriter.h.

Member Typedef Documentation

◆ DataType

template<PatchAttribs A, typename T , bool Required, bool Optional>
using skgpu::tess::AttribValue< A, T, Required, Optional >::DataType = std::conditional_t<Required, T, std::conditional_t<Optional, std::pair<T, bool>, std::monostate> >

Definition at line 135 of file PatchWriter.h.

Constructor & Destructor Documentation

◆ AttribValue() [1/2]

template<PatchAttribs A, typename T , bool Required, bool Optional>
skgpu::tess::AttribValue< A, T, Required, Optional >::AttribValue ( PatchAttribs  attribs)
inlineexplicit

Definition at line 141 of file PatchWriter.h.

141: AttribValue(attribs, {}) {}
AttribValue(PatchAttribs attribs)
Definition: PatchWriter.h:141

◆ AttribValue() [2/2]

template<PatchAttribs A, typename T , bool Required, bool Optional>
skgpu::tess::AttribValue< A, T, Required, Optional >::AttribValue ( PatchAttribs  attribs,
const T t 
)
inline

Definition at line 142 of file PatchWriter.h.

142 {
143 (void) attribs; // may be unused on release builds
144 if constexpr (Required) {
145 SkASSERT(attribs & A);
146 } else if constexpr (Optional) {
147 std::get<1>(fV) = attribs & A;
148 } else {
149 SkASSERT(!(attribs & A));
150 }
151 *this = t;
152 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
const myers::Point & get< 1 >(const myers::Segment &s)
Definition: Myers.h:81

Member Function Documentation

◆ operator=()

template<PatchAttribs A, typename T , bool Required, bool Optional>
AttribValue & skgpu::tess::AttribValue< A, T, Required, Optional >::operator= ( const T v)
inline

Definition at line 154 of file PatchWriter.h.

154 {
155 if constexpr (Required) {
156 fV = v;
157 } else if constexpr (Optional) {
158 // for simplicity, store even if disabled and won't be written out to VertexWriter
159 std::get<0>(fV) = v;
160 } // else ignore for disabled values
161 return *this;
162 }
const myers::Point & get< 0 >(const myers::Segment &s)
Definition: Myers.h:80

Member Data Documentation

◆ fV

template<PatchAttribs A, typename T , bool Required, bool Optional>
DataType skgpu::tess::AttribValue< A, T, Required, Optional >::fV

Definition at line 164 of file PatchWriter.h.

◆ kEnabled

template<PatchAttribs A, typename T , bool Required, bool Optional>
constexpr bool skgpu::tess::AttribValue< A, T, Required, Optional >::kEnabled = Required || Optional
staticconstexpr

Definition at line 139 of file PatchWriter.h.


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