Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
ShaderPDXferProcessor Class Reference
Inheritance diagram for ShaderPDXferProcessor:
GrXferProcessor GrProcessor GrNonAtomicRef< GrXferProcessor > SkNoncopyable

Public Member Functions

 ShaderPDXferProcessor (SkBlendMode xfermode, GrProcessorAnalysisCoverage coverage)
 
const char * name () const override
 
std::unique_ptr< ProgramImplmakeProgramImpl () const override
 
- Public Member Functions inherited from GrXferProcessor
void addToKey (const GrShaderCaps &, skgpu::KeyBuilder *, const GrSurfaceOrigin *originIfDstTexture, bool usesInputAttachmentForDstRead) const
 
virtual std::unique_ptr< ProgramImplmakeProgramImpl () const =0
 
virtual GrXferBarrierType xferBarrierType (const GrCaps &caps) const
 
skgpu::BlendInfo getBlendInfo () const
 
bool willReadDstColor () const
 
bool hasSecondaryOutput () const
 
bool isLCD () const
 
bool isEqual (const GrXferProcessor &that) const
 
- Public Member Functions inherited from GrProcessor
virtual ~GrProcessor ()=default
 
virtual const char * name () const =0
 
void * operator new (size_t size)
 
void * operator new (size_t object_size, size_t footer_size)
 
void operator delete (void *target)
 
void * operator new (size_t size, void *placement)
 
void operator delete (void *target, void *placement)
 
template<typename T >
const Tcast () const
 
ClassID classID () const
 
- Public Member Functions inherited from GrNonAtomicRef< GrXferProcessor >
 GrNonAtomicRef ()
 
bool unique () const
 
int refCnt () const
 
void ref () const
 
void unref () const
 
- Public Member Functions inherited from SkNoncopyable
 SkNoncopyable ()=default
 
 SkNoncopyable (SkNoncopyable &&)=default
 
SkNoncopyableoperator= (SkNoncopyable &&)=default
 

Additional Inherited Members

- Public Types inherited from GrProcessor
enum  ClassID {
  kNull_ClassID , kAttributeTestProcessor_ClassID , kBigKeyProcessor_ClassID , kBlendFragmentProcessor_ClassID ,
  kBlockInputFragmentProcessor_ClassID , kButtCapStrokedCircleGeometryProcessor_ClassID , kCircleGeometryProcessor_ClassID , kCircularRRectEffect_ClassID ,
  kClockwiseTestProcessor_ClassID , kColorTableEffect_ClassID , kCoverageSetOpXP_ClassID , kCustomXP_ClassID ,
  kDashingCircleEffect_ClassID , kDashingLineEffect_ClassID , kDefaultGeoProc_ClassID , kDeviceSpace_ClassID ,
  kDIEllipseGeometryProcessor_ClassID , kDisableColorXP_ClassID , kDrawAtlasPathShader_ClassID , kEllipseGeometryProcessor_ClassID ,
  kEllipticalRRectEffect_ClassID , kFwidthSquircleTestProcessor_ClassID , kGP_ClassID , kGrBicubicEffect_ClassID ,
  kGrBitmapTextGeoProc_ClassID , kGrColorSpaceXformEffect_ClassID , kGrConicEffect_ClassID , kGrConvexPolyEffect_ClassID ,
  kGrDiffuseLightingEffect_ClassID , kGrDisplacementMapEffect_ClassID , kGrDistanceFieldA8TextGeoProc_ClassID , kGrDistanceFieldLCDTextGeoProc_ClassID ,
  kGrDistanceFieldPathGeoProc_ClassID , kGrFillRRectOp_Processor_ClassID , kGrGaussianConvolutionFragmentProcessor_ClassID , kGrMatrixConvolutionEffect_ClassID ,
  kGrMatrixEffect_ClassID , kGrMeshTestProcessor_ClassID , kGrMorphologyEffect_ClassID , kGrPerlinNoise2Effect_ClassID ,
  kGrPipelineDynamicStateTestProcessor_ClassID , kGrQuadEffect_ClassID , kGrRRectShadowGeoProc_ClassID , kGrSkSLFP_ClassID ,
  kGrSpecularLightingEffect_ClassID , kGrTextureEffect_ClassID , kGrUnrolledBinaryGradientColorizer_ClassID , kGrYUVtoRGBEffect_ClassID ,
  kHighPrecisionFragmentProcessor_ClassID , kLatticeGP_ClassID , kPDLCDXferProcessor_ClassID , kPorterDuffXferProcessor_ClassID ,
  kPremulFragmentProcessor_ClassID , kQuadEdgeEffect_ClassID , kQuadPerEdgeAAGeometryProcessor_ClassID , kSeriesFragmentProcessor_ClassID ,
  kShaderPDXferProcessor_ClassID , kSurfaceColorProcessor_ClassID , kSwizzleFragmentProcessor_ClassID , kTessellate_BoundingBoxShader_ClassID ,
  kTessellate_GrModulateAtlasCoverageEffect_ClassID , kTessellate_GrStrokeTessellationShader_ClassID , kTessellate_HullShader_ClassID , kTessellate_MiddleOutShader_ClassID ,
  kTessellate_SimpleTriangleShader_ClassID , kTessellationTestTriShader_ClassID , kTestFP_ClassID , kTestRectOp_ClassID ,
  kVertexColorSpaceBenchGP_ClassID , kVerticesGP_ClassID
}
 
- Protected Member Functions inherited from GrXferProcessor
 GrXferProcessor (ClassID classID)
 
 GrXferProcessor (ClassID classID, bool willReadDstColor, GrProcessorAnalysisCoverage)
 
- Protected Member Functions inherited from GrProcessor
 GrProcessor (ClassID classID)
 
 GrProcessor (const GrProcessor &)=delete
 
GrProcessoroperator= (const GrProcessor &)=delete
 
- Protected Attributes inherited from GrProcessor
const ClassID fClassID
 

Detailed Description

Definition at line 139 of file GrPorterDuffXferProcessor.cpp.

Constructor & Destructor Documentation

◆ ShaderPDXferProcessor()

ShaderPDXferProcessor::ShaderPDXferProcessor ( SkBlendMode  xfermode,
GrProcessorAnalysisCoverage  coverage 
)
inline

Definition at line 141 of file GrPorterDuffXferProcessor.cpp.

142 : INHERITED(kShaderPDXferProcessor_ClassID, /*willReadDstColor=*/true, coverage)
143 , fXfermode(xfermode) {
144 }
@ kShaderPDXferProcessor_ClassID
Definition: GrProcessor.h:82

Member Function Documentation

◆ makeProgramImpl()

std::unique_ptr< GrXferProcessor::ProgramImpl > ShaderPDXferProcessor::makeProgramImpl ( ) const
overridevirtual

Returns a new instance of the appropriate GL implementation class for the given GrXferProcessor; caller is responsible for deleting the object.

Implements GrXferProcessor.

Definition at line 170 of file GrPorterDuffXferProcessor.cpp.

170 {
171 class Impl : public ProgramImpl {
172 private:
173 void emitBlendCodeForDstRead(GrGLSLXPFragmentBuilder* fragBuilder,
174 GrGLSLUniformHandler* uniformHandler,
175 const char* srcColor,
176 const char* srcCoverage,
177 const char* dstColor,
178 const char* outColor,
179 const char* outColorSecondary,
180 const GrXferProcessor& proc) override {
182
183 std::string blendExpr = GrGLSLBlend::BlendExpression(
184 &xp, uniformHandler, &fBlendUniform, srcColor, dstColor, xp.fXfermode);
185 fragBuilder->codeAppendf("%s = %s;", outColor, blendExpr.c_str());
186
187 // Apply coverage.
188 DefaultCoverageModulation(fragBuilder,
189 srcCoverage,
190 dstColor,
191 outColor,
192 outColorSecondary,
193 xp);
194 }
195
196 void onSetData(const GrGLSLProgramDataManager& pdman,
197 const GrXferProcessor& proc) override {
198 if (fBlendUniform.isValid()) {
200 GrGLSLBlend::SetBlendModeUniformData(pdman, fBlendUniform, xp.fXfermode);
201 }
202 }
203
205 };
206
207 return std::make_unique<Impl>();
208}
void codeAppendf(const char format[],...) SK_PRINTF_LIKE(2
GrGLSLProgramDataManager::UniformHandle UniformHandle
const T & cast() const
Definition: GrProcessor.h:127
std::string BlendExpression(const GrProcessor *processor, GrGLSLUniformHandler *uniformHandler, GrGLSLProgramDataManager::UniformHandle *blendUniform, const char *srcColor, const char *dstColor, SkBlendMode mode)
Definition: GrGLSLBlend.cpp:20
void SetBlendModeUniformData(const GrGLSLProgramDataManager &pdman, GrGLSLProgramDataManager::UniformHandle blendUniform, SkBlendMode mode)
Definition: GrGLSLBlend.cpp:73

◆ name()

const char * ShaderPDXferProcessor::name ( ) const
inlineoverridevirtual

Human-meaningful string to identify this processor; may be embedded in generated shader code and must be a legal SkSL identifier prefix.

Implements GrProcessor.

Definition at line 146 of file GrPorterDuffXferProcessor.cpp.

146{ return "Porter Duff Shader"; }

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