28 , fInvertCoverage(invertCoverage) {}
30 const char*
name()
const override {
return "Coverage Set Op"; }
41 return (fRegionOp == xp.fRegionOp &&
42 fInvertCoverage == xp.fInvertCoverage);
52 b->addBool(fInvertCoverage,
"invert coverage");
58 void emitOutputsForBlendState(
const EmitArgs&
args)
override {
61 if (xp.fInvertCoverage) {
62 fb->codeAppendf(
"%s = 1.0 - %s;",
args.fOutputPrimary,
args.fInputCoverage);
64 fb->codeAppendf(
"%s = %s;",
args.fOutputPrimary,
args.fInputCoverage);
68 return std::make_unique<Impl>();
103constexpr GrCoverageSetOpXPFactory::GrCoverageSetOpXPFactory(
SkRegion::Op regionOp,
105 : fRegionOp(regionOp), fInvertCoverage(invertCoverage) {}
110 if (invertCoverage) {
113 return &gReplaceCDXPFI;
117 return &gReplaceCDXPF;
121 if (invertCoverage) {
124 return &gIntersectCDXPFI;
128 return &gIntersectCDXPF;
132 if (invertCoverage) {
135 return &gUnionCDXPFI;
143 if (invertCoverage) {
152 if (invertCoverage) {
155 return &gDifferenceCDXPFI;
159 return &gDifferenceCDXPF;
163 if (invertCoverage) {
166 return &gRevDiffCDXPFI;
170 return &gRevDiffCDXPF;
187#if defined(GR_TEST_UTILS)
188const GrXPFactory* GrCoverageSetOpXPFactory::TestGet(GrProcessorTestData*
d) {
190 bool invertCoverage =
d->fRandom->nextBool();
GrProcessorAnalysisCoverage
#define GR_DEFINE_XP_FACTORY_TEST(...)
#define SK_ABORT(message,...)
constexpr SkPMColor4f SK_PMColor4fTRANSPARENT
CoverageSetOpXP(SkRegion::Op regionOp, bool invertCoverage)
std::unique_ptr< ProgramImpl > makeProgramImpl() const override
const char * name() const override
static const GrXPFactory * Get(SkRegion::Op regionOp, bool invertCoverage=false)
@ kCoverageSetOpXP_ClassID
GrXferProcessor(ClassID classID)
@ kReverseDifference_Op
operand minus target
@ kUnion_Op
target unioned with operand
@ kReplace_Op
replace target with operand
@ kIntersect_Op
target intersected with operand
@ kDifference_Op
target minus operand
@ kXOR_Op
target exclusive or with operand
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
skgpu::BlendCoeff fDstBlend
SkPMColor4f fBlendConstant
skgpu::BlendCoeff fSrcBlend