Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GrUserStencilSettings Struct Reference

#include <GrUserStencilSettings.h>

Classes

struct  Attrs
 
struct  Init
 
struct  InitSeparate
 

Public Types

typedef GrTStencilFaceSettings< GrUserStencilTest, GrUserStencilOpFace
 

Public Member Functions

template<uint16_t Ref, GrUserStencilTest Test, uint16_t TestMask, GrUserStencilOp PassOp, GrUserStencilOp FailOp, uint16_t WriteMask, typename Attrs = Attrs<Test, PassOp, FailOp>>
constexpr GrUserStencilSettings (const Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > &)
 
template<uint16_t CWRef, uint16_t CCWRef, GrUserStencilTest CWTest, GrUserStencilTest CCWTest, uint16_t CWTestMask, uint16_t CCWTestMask, GrUserStencilOp CWPassOp, GrUserStencilOp CCWPassOp, GrUserStencilOp CWFailOp, GrUserStencilOp CCWFailOp, uint16_t CWWriteMask, uint16_t CCWWriteMask, typename CWAttrs = Attrs<CWTest, CWPassOp, CWFailOp>, typename CCWAttrs = Attrs<CCWTest, CCWPassOp, CCWFailOp>>
constexpr GrUserStencilSettings (const InitSeparate< CWRef, CCWRef, CWTest, CCWTest, CWTestMask, CCWTestMask, CWPassOp, CCWPassOp, CWFailOp, CCWFailOp, CWWriteMask, CCWWriteMask > &)
 
 GrUserStencilSettings ()=delete
 
 GrUserStencilSettings (const GrUserStencilSettings &)=delete
 
uint16_t flags (bool hasStencilClip) const
 
bool isDisabled (bool hasStencilClip) const
 
bool testAlwaysPasses (bool hasStencilClip) const
 
bool isTwoSided (bool hasStencilClip) const
 
bool usesWrapOp (bool hasStencilClip) const
 
bool isUnused () const
 

Static Public Member Functions

template<uint16_t Ref, GrUserStencilTest Test, uint16_t TestMask, GrUserStencilOp PassOp, GrUserStencilOp FailOp, uint16_t WriteMask>
static constexpr Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > StaticInit ()
 
template<uint16_t CWRef, uint16_t CCWRef, GrUserStencilTest CWTest, GrUserStencilTest CCWTest, uint16_t CWTestMask, uint16_t CCWTestMask, GrUserStencilOp CWPassOp, GrUserStencilOp CCWPassOp, GrUserStencilOp CWFailOp, GrUserStencilOp CCWFailOp, uint16_t CWWriteMask, uint16_t CCWWriteMask>
static constexpr InitSeparate< CWRef, CCWRef, CWTest, CCWTest, CWTestMask, CCWTestMask, CWPassOp, CCWPassOp, CWFailOp, CCWFailOp, CWWriteMask, CCWWriteMask > StaticInitSeparate ()
 

Public Attributes

const uint16_t fCWFlags [2]
 
const Face fCWFace
 
const uint16_t fCCWFlags [2]
 
const Face fCCWFace
 

Static Public Attributes

static const GrUserStencilSettingskUnused = gUnused
 

Detailed Description

This struct is a compile-time constant representation of user stencil settings. It describes in abstract terms how a draw will use the stencil buffer. It gets ODR-used at runtime to define a draw's stencil settings, and is later translated into concrete settings when the pipeline is finalized.

Definition at line 112 of file GrUserStencilSettings.h.

Member Typedef Documentation

◆ Face

Definition at line 113 of file GrUserStencilSettings.h.

Constructor & Destructor Documentation

◆ GrUserStencilSettings() [1/4]

template<uint16_t Ref, GrUserStencilTest Test, uint16_t TestMask, GrUserStencilOp PassOp, GrUserStencilOp FailOp, uint16_t WriteMask, typename Attrs = Attrs<Test, PassOp, FailOp>>
constexpr GrUserStencilSettings::GrUserStencilSettings ( const Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > &  )
inlineexplicitconstexpr

Definition at line 152 of file GrUserStencilSettings.h.

154 : fCWFlags{(uint16_t)(Attrs::Flags(false) | kSingleSided_StencilFlag),
155 (uint16_t)(Attrs::Flags(true) | kSingleSided_StencilFlag)}
156 , fCWFace{Ref, Test, Attrs::EffectiveTestMask(TestMask), PassOp, FailOp,
157 Attrs::EffectiveWriteMask(WriteMask)}
158 , fCCWFlags{(uint16_t)(Attrs::Flags(false) | kSingleSided_StencilFlag),
159 (uint16_t)(Attrs::Flags(true) | kSingleSided_StencilFlag)}
160 , fCCWFace{Ref, Test, Attrs::EffectiveTestMask(TestMask), PassOp, FailOp,
161 Attrs::EffectiveWriteMask(WriteMask)} {
162 }
@ kSingleSided_StencilFlag
RefPtr< T > Ref(T *ptr)
Definition: ref_ptr.h:237
static constexpr uint16_t EffectiveWriteMask(uint16_t writeMask)
static constexpr uint16_t Flags(bool hasStencilClip)
static constexpr uint16_t EffectiveTestMask(uint16_t testMask)

◆ GrUserStencilSettings() [2/4]

template<uint16_t CWRef, uint16_t CCWRef, GrUserStencilTest CWTest, GrUserStencilTest CCWTest, uint16_t CWTestMask, uint16_t CCWTestMask, GrUserStencilOp CWPassOp, GrUserStencilOp CCWPassOp, GrUserStencilOp CWFailOp, GrUserStencilOp CCWFailOp, uint16_t CWWriteMask, uint16_t CCWWriteMask, typename CWAttrs = Attrs<CWTest, CWPassOp, CWFailOp>, typename CCWAttrs = Attrs<CCWTest, CCWPassOp, CCWFailOp>>
constexpr GrUserStencilSettings::GrUserStencilSettings ( const InitSeparate< CWRef, CCWRef, CWTest, CCWTest, CWTestMask, CCWTestMask, CWPassOp, CCWPassOp, CWFailOp, CCWFailOp, CWWriteMask, CCWWriteMask > &  )
inlineexplicitconstexpr

Definition at line 172 of file GrUserStencilSettings.h.

176 : fCWFlags{CWAttrs::Flags(false), CWAttrs::Flags(true)}
177 , fCWFace{CWRef, CWTest, CWAttrs::EffectiveTestMask(CWTestMask), CWPassOp, CWFailOp,
178 CWAttrs::EffectiveWriteMask(CWWriteMask)}
180 , fCCWFace{CCWRef, CCWTest, CCWAttrs::EffectiveTestMask(CCWTestMask), CCWPassOp, CCWFailOp,
181 CCWAttrs::EffectiveWriteMask(CCWWriteMask)} {}

◆ GrUserStencilSettings() [3/4]

GrUserStencilSettings::GrUserStencilSettings ( )
delete

◆ GrUserStencilSettings() [4/4]

GrUserStencilSettings::GrUserStencilSettings ( const GrUserStencilSettings )
delete

Member Function Documentation

◆ flags()

uint16_t GrUserStencilSettings::flags ( bool  hasStencilClip) const
inline

Definition at line 187 of file GrUserStencilSettings.h.

187 {
188 return fCWFlags[hasStencilClip] & fCCWFlags[hasStencilClip];
189 }

◆ isDisabled()

bool GrUserStencilSettings::isDisabled ( bool  hasStencilClip) const
inline

Definition at line 190 of file GrUserStencilSettings.h.

190 {
191 return this->flags(hasStencilClip) & kDisabled_StencilFlag;
192 }
@ kDisabled_StencilFlag
uint16_t flags(bool hasStencilClip) const

◆ isTwoSided()

bool GrUserStencilSettings::isTwoSided ( bool  hasStencilClip) const
inline

Definition at line 196 of file GrUserStencilSettings.h.

196 {
197 return !(this->flags(hasStencilClip) & kSingleSided_StencilFlag);
198 }

◆ isUnused()

bool GrUserStencilSettings::isUnused ( ) const
inline

Definition at line 210 of file GrUserStencilSettings.h.

210{ return this == &kUnused; }
static const GrUserStencilSettings & kUnused

◆ StaticInit()

template<uint16_t Ref, GrUserStencilTest Test, uint16_t TestMask, GrUserStencilOp PassOp, GrUserStencilOp FailOp, uint16_t WriteMask>
static constexpr Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > GrUserStencilSettings::StaticInit ( )
inlinestaticconstexpr

Definition at line 130 of file GrUserStencilSettings.h.

130 {
131 return Init<Ref, Test, TestMask, PassOp, FailOp, WriteMask>();
132 }

◆ StaticInitSeparate()

template<uint16_t CWRef, uint16_t CCWRef, GrUserStencilTest CWTest, GrUserStencilTest CCWTest, uint16_t CWTestMask, uint16_t CCWTestMask, GrUserStencilOp CWPassOp, GrUserStencilOp CCWPassOp, GrUserStencilOp CWFailOp, GrUserStencilOp CCWFailOp, uint16_t CWWriteMask, uint16_t CCWWriteMask>
static constexpr InitSeparate< CWRef, CCWRef, CWTest, CCWTest, CWTestMask, CCWTestMask, CWPassOp, CCWPassOp, CWFailOp, CCWFailOp, CWWriteMask, CCWWriteMask > GrUserStencilSettings::StaticInitSeparate ( )
inlinestaticconstexpr

Definition at line 142 of file GrUserStencilSettings.h.

142 {
143 return InitSeparate<CWRef, CCWRef, CWTest, CCWTest, CWTestMask, CCWTestMask,
144 CWPassOp, CCWPassOp, CWFailOp, CCWFailOp, CWWriteMask, CCWWriteMask>();
145 }

◆ testAlwaysPasses()

bool GrUserStencilSettings::testAlwaysPasses ( bool  hasStencilClip) const
inline

Definition at line 193 of file GrUserStencilSettings.h.

193 {
194 return this->flags(hasStencilClip) & kTestAlwaysPasses_StencilFlag;
195 }
@ kTestAlwaysPasses_StencilFlag

◆ usesWrapOp()

bool GrUserStencilSettings::usesWrapOp ( bool  hasStencilClip) const
inline

Definition at line 199 of file GrUserStencilSettings.h.

199 {
200 return !(this->flags(hasStencilClip) & kNoWrapOps_StencilFlag);
201 }
@ kNoWrapOps_StencilFlag

Member Data Documentation

◆ fCCWFace

const Face GrUserStencilSettings::fCCWFace

Definition at line 206 of file GrUserStencilSettings.h.

◆ fCCWFlags

const uint16_t GrUserStencilSettings::fCCWFlags[2]

Definition at line 205 of file GrUserStencilSettings.h.

◆ fCWFace

const Face GrUserStencilSettings::fCWFace

Definition at line 204 of file GrUserStencilSettings.h.

◆ fCWFlags

const uint16_t GrUserStencilSettings::fCWFlags[2]

Definition at line 203 of file GrUserStencilSettings.h.

◆ kUnused

const GrUserStencilSettings & GrUserStencilSettings::kUnused = gUnused
static

Definition at line 208 of file GrUserStencilSettings.h.


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