Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
GrCoverageSetOpXPFactory Class Reference

#include <GrCoverageSetOpXP.h>

Inheritance diagram for GrCoverageSetOpXPFactory:
GrXPFactory

Static Public Member Functions

static const GrXPFactoryGet (SkRegion::Op regionOp, bool invertCoverage=false)
 
- Static Public Member Functions inherited from GrXPFactory
static sk_sp< const GrXferProcessorMakeXferProcessor (const GrXPFactory *, const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &caps, GrClampType)
 
static AnalysisProperties GetAnalysisProperties (const GrXPFactory *, const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType)
 
static const GrXPFactoryFromBlendMode (SkBlendMode)
 

Additional Inherited Members

- Public Types inherited from GrXPFactory
enum class  AnalysisProperties : unsigned {
  kNone = 0x0 , kReadsDstInShader = 0x1 , kCompatibleWithCoverageAsAlpha = 0x2 , kIgnoresInputColor = 0x4 ,
  kRequiresDstTexture = 0x10 , kRequiresNonOverlappingDraws = 0x20 , kUsesNonCoherentHWBlending = 0x40 , kUnaffectedByDstValue = 0x80
}
 
- Public Member Functions inherited from GrXPFactory
 GR_DECL_BITFIELD_CLASS_OPS_FRIENDS (AnalysisProperties)
 
- Protected Member Functions inherited from GrXPFactory
constexpr GrXPFactory ()
 

Detailed Description

This xfer processor directly blends the the src coverage with the dst using a set operator. It is useful for rendering coverage masks using CSG. It can optionally invert the src coverage before applying the set operator.

Definition at line 35 of file GrCoverageSetOpXP.h.

Member Function Documentation

◆ Get()

const GrXPFactory * GrCoverageSetOpXPFactory::Get ( SkRegion::Op  regionOp,
bool  invertCoverage = false 
)
static

Definition at line 107 of file GrCoverageSetOpXP.cpp.

107 {
108 switch (regionOp) {
110 if (invertCoverage) {
111 static constexpr const GrCoverageSetOpXPFactory gReplaceCDXPFI(
113 return &gReplaceCDXPFI;
114 } else {
115 static constexpr const GrCoverageSetOpXPFactory gReplaceCDXPF(SkRegion::kReplace_Op,
116 false);
117 return &gReplaceCDXPF;
118 }
119 }
121 if (invertCoverage) {
122 static constexpr const GrCoverageSetOpXPFactory gIntersectCDXPFI(
124 return &gIntersectCDXPFI;
125 } else {
126 static constexpr const GrCoverageSetOpXPFactory gIntersectCDXPF(
128 return &gIntersectCDXPF;
129 }
130 }
131 case SkRegion::kUnion_Op: {
132 if (invertCoverage) {
133 static constexpr const GrCoverageSetOpXPFactory gUnionCDXPFI(SkRegion::kUnion_Op,
134 true);
135 return &gUnionCDXPFI;
136 } else {
137 static constexpr const GrCoverageSetOpXPFactory gUnionCDXPF(SkRegion::kUnion_Op,
138 false);
139 return &gUnionCDXPF;
140 }
141 }
142 case SkRegion::kXOR_Op: {
143 if (invertCoverage) {
144 static constexpr const GrCoverageSetOpXPFactory gXORCDXPFI(SkRegion::kXOR_Op, true);
145 return &gXORCDXPFI;
146 } else {
147 static constexpr const GrCoverageSetOpXPFactory gXORCDXPF(SkRegion::kXOR_Op, false);
148 return &gXORCDXPF;
149 }
150 }
152 if (invertCoverage) {
153 static constexpr const GrCoverageSetOpXPFactory gDifferenceCDXPFI(
155 return &gDifferenceCDXPFI;
156 } else {
157 static constexpr const GrCoverageSetOpXPFactory gDifferenceCDXPF(
159 return &gDifferenceCDXPF;
160 }
161 }
163 if (invertCoverage) {
164 static constexpr const GrCoverageSetOpXPFactory gRevDiffCDXPFI(
166 return &gRevDiffCDXPFI;
167 } else {
168 static constexpr const GrCoverageSetOpXPFactory gRevDiffCDXPF(
170 return &gRevDiffCDXPF;
171 }
172 }
173 }
174 SK_ABORT("Unknown region op.");
175}
#define SK_ABORT(message,...)
Definition: SkAssert.h:70
@ kReverseDifference_Op
operand minus target
Definition: SkRegion.h:371
@ kUnion_Op
target unioned with operand
Definition: SkRegion.h:369
@ kReplace_Op
replace target with operand
Definition: SkRegion.h:372
@ kIntersect_Op
target intersected with operand
Definition: SkRegion.h:368
@ kDifference_Op
target minus operand
Definition: SkRegion.h:367
@ kXOR_Op
target exclusive or with operand
Definition: SkRegion.h:370

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