Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
GrUserStencilSettings::Attrs< Test, PassOp, FailOp > Struct Template Reference

#include <GrUserStencilSettings.h>

Static Public Member Functions

static constexpr bool TestAlwaysPasses (bool hasStencilClip)
 
static constexpr bool DoesNotModifyStencil (bool hasStencilClip)
 
static constexpr bool IsDisabled (bool hasStencilClip)
 
static constexpr bool UsesWrapOps ()
 
static constexpr bool TestIgnoresRef ()
 
static constexpr uint16_t Flags (bool hasStencilClip)
 
static constexpr uint16_t EffectiveTestMask (uint16_t testMask)
 
static constexpr uint16_t EffectiveWriteMask (uint16_t writeMask)
 

Detailed Description

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
struct GrUserStencilSettings::Attrs< Test, PassOp, FailOp >

Definition at line 214 of file GrUserStencilSettings.h.

Member Function Documentation

◆ DoesNotModifyStencil()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr bool GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::DoesNotModifyStencil ( bool  hasStencilClip)
inlinestaticconstexpr

Definition at line 226 of file GrUserStencilSettings.h.

226 {
227 return (GrUserStencilTest::kNever == Test || GrUserStencilOp::kKeep == PassOp) &&
228 (TestAlwaysPasses(hasStencilClip) || GrUserStencilOp::kKeep == FailOp);
229 }
static constexpr bool TestAlwaysPasses(bool hasStencilClip)

◆ EffectiveTestMask()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr uint16_t GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::EffectiveTestMask ( uint16_t  testMask)
inlinestaticconstexpr

Definition at line 247 of file GrUserStencilSettings.h.

247 {
248 return TestIgnoresRef() ? 0 : testMask;
249 }
static constexpr bool TestIgnoresRef()

◆ EffectiveWriteMask()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr uint16_t GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::EffectiveWriteMask ( uint16_t  writeMask)
inlinestaticconstexpr

Definition at line 250 of file GrUserStencilSettings.h.

250 {
251 // We don't modify the mask differently when hasStencilClip=false because either the entire
252 // face gets disabled in that case (e.g. Test=kAlwaysIfInClip, PassOp=kKeep), or else the
253 // effective mask stays the same either way.
254 return DoesNotModifyStencil(true) ? 0 : writeMask;
255 }
static constexpr bool DoesNotModifyStencil(bool hasStencilClip)

◆ Flags()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr uint16_t GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::Flags ( bool  hasStencilClip)
inlinestaticconstexpr

Definition at line 241 of file GrUserStencilSettings.h.

241 {
242 return (IsDisabled(hasStencilClip) ? kDisabled_StencilFlag : 0) |
243 (TestAlwaysPasses(hasStencilClip) ? kTestAlwaysPasses_StencilFlag : 0) |
244 (DoesNotModifyStencil(hasStencilClip) ? kNoModifyStencil_StencilFlag : 0) |
246 }
@ kTestAlwaysPasses_StencilFlag
@ kDisabled_StencilFlag
@ kNoWrapOps_StencilFlag
@ kNoModifyStencil_StencilFlag
static constexpr bool UsesWrapOps()
static constexpr bool IsDisabled(bool hasStencilClip)

◆ IsDisabled()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr bool GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::IsDisabled ( bool  hasStencilClip)
inlinestaticconstexpr

Definition at line 230 of file GrUserStencilSettings.h.

230 {
231 return TestAlwaysPasses(hasStencilClip) && DoesNotModifyStencil(hasStencilClip);
232 }

◆ TestAlwaysPasses()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr bool GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::TestAlwaysPasses ( bool  hasStencilClip)
inlinestaticconstexpr

Definition at line 222 of file GrUserStencilSettings.h.

◆ TestIgnoresRef()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr bool GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::TestIgnoresRef ( )
inlinestaticconstexpr

Definition at line 237 of file GrUserStencilSettings.h.

237 {
240 }

◆ UsesWrapOps()

template<GrUserStencilTest Test, GrUserStencilOp PassOp, GrUserStencilOp FailOp>
static constexpr bool GrUserStencilSettings::Attrs< Test, PassOp, FailOp >::UsesWrapOps ( )
inlinestaticconstexpr

Definition at line 233 of file GrUserStencilSettings.h.

233 {
234 return GrUserStencilOp::kIncWrap == PassOp || GrUserStencilOp::kDecWrap == PassOp ||
236 }

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