32 uint16_t cwFlags = user.
fCWFlags[hasStencilClip];
37 fCWFace.
reset(user.
fCWFace, hasStencilClip, numStencilBits);
42 uint16_t ccwFlags = user.
fCCWFlags[hasStencilClip];
43 fFlags = cwFlags & ccwFlags;
48 fCWFace.
reset(user.
fCWFace, hasStencilClip, numStencilBits);
53 fCCWFace.
reset(user.
fCCWFace, hasStencilClip, numStencilBits);
65 memcpy(&fCWFace, &that.fCWFace,
sizeof(
Face));
67 memcpy(&fCWFace, &that.fCWFace, 2 *
sizeof(
Face));
68 static_assert(
sizeof(
Face) ==
76 if (kInvalid_PrivateFlag & (fFlags | that.fFlags)) {
83 return 0 == memcmp(&fCWFace, &that.fCWFace,
sizeof(
Face));
87 return 0 == memcmp(&fCWFace, &that.fCWFace, 2 *
sizeof(
Face));
88 static_assert(
sizeof(
Face) ==
92 static_assert(0 == offsetof(
Face, fRef));
94 static_assert(2 == offsetof(
Face, fTest));
96 static_assert(4 == offsetof(
Face, fTestMask));
98 static_assert(6 == offsetof(
Face, fPassOp));
100 static_assert(7 == offsetof(
Face, fFailOp));
102 static_assert(8 == offsetof(
Face, fWriteMask));
104 static_assert(10 ==
sizeof(
Face));
175 int numStencilBits) {
179 SkASSERT(numStencilBits > 0 && numStencilBits <= 16);
180 int clipBit = 1 << (numStencilBits - 1);
181 int userMask = clipBit - 1;
221 memset(
this, 0,
sizeof(*
this));
250 b->addBits(6, fFlags,
"stencilFlags");
256 b->addBytes(
sizeof(
Face), &fCWFace,
"stencilCWFace");
258 Face tempFace = fCWFace;
260 b->addBytes(
sizeof(
Face), &tempFace,
"stencilCWFace");
264 b->addBytes(
sizeof(
Face), &fCWFace,
"stencilCWFace");
265 b->addBytes(
sizeof(
Face), &fCCWFace,
"stencilCCWFace");
268 tempFaces[0] = fCWFace;
269 tempFaces[0].
fRef = 0;
270 tempFaces[1] = fCCWFace;
271 tempFaces[1].
fRef = 0;
272 b->addBytes(
sizeof(
Face), &tempFaces[0],
"stencilCWFace");
273 b->addBytes(
sizeof(
Face), &tempFaces[1],
"stencilCCWFace");
277 static_assert(0 == offsetof(
Face, fRef));
279 static_assert(2 == offsetof(
Face, fTest));
281 static_assert(4 == offsetof(
Face, fTestMask));
283 static_assert(6 == offsetof(
Face, fPassOp));
285 static_assert(7 == offsetof(
Face, fFailOp));
287 static_assert(8 == offsetof(
Face, fWriteMask));
289 static_assert(10 ==
sizeof(
Face));
static constexpr GrUserStencilSettings gSetStencilClipBit(GrUserStencilSettings::StaticInit< 0x0000, GrUserStencilTest::kAlways, 0xffff, GrUserStencilOp::kSetClipBit, GrUserStencilOp::kSetClipBit, 0x0000 >())
static constexpr GrUserStencilSettings gZeroStencilClipBit(GrUserStencilSettings::StaticInit< 0x0000, GrUserStencilTest::kAlways, 0xffff, GrUserStencilOp::kZeroClipBit, GrUserStencilOp::kZeroClipBit, 0x0000 >())
static constexpr GrStencilOp gUserStencilOpToRaw[kGrUserStencilOpCount]
static constexpr GrStencilTest gUserStencilTestToRaw[kGrUserStencilTestCount]
constexpr const GrUserStencilSettings gUnused(GrUserStencilSettings::StaticInit< 0x0000, GrUserStencilTest::kAlwaysIfInClip, 0xffff, GrUserStencilOp::kKeep, GrUserStencilOp::kKeep, 0x0000 >())
@ kSetClipAndReplaceUserBits
static constexpr GrUserStencilOp kLastUserOnlyStencilOp
@ kSingleSided_StencilFlag
static constexpr GrUserStencilOp kLastClipOnlyStencilOp
static constexpr GrUserStencilTest kLastClippedStencilTest
static constexpr int kGrUserStencilOpCount
static constexpr int kGrUserStencilTestCount
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
void genKey(skgpu::KeyBuilder *b, bool includeRefsAndMasks) const
void reset(const GrUserStencilSettings &, bool hasStencilClip, int numStencilBits)
static const GrUserStencilSettings * SetClipBitSettings(bool setToInside)
bool operator==(const GrStencilSettings &) const
static float max(float r, float g, float b)
static float min(float r, float g, float b)
void reset(const GrUserStencilSettings::Face &, bool useStencilClip, int numStencilBits)
static constexpr Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > StaticInit()
const uint16_t fCWFlags[2]
static const GrUserStencilSettings & kUnused
const uint16_t fCCWFlags[2]