8#ifndef GrXferProcessor_DEFINED
9#define GrXferProcessor_DEFINED
29namespace skgpu {
class KeyBuilder; }
85 bool usesInputAttachmentForDstRead)
const;
103 if (!this->willReadDstColor()) {
104 this->onGetBlendInfo(&blendInfo);
115 bool hasSecondaryOutput()
const;
117 bool isLCD()
const {
return fIsLCD; }
128 if (this->classID() != that.
classID()) {
131 if (this->fWillReadDstColor != that.fWillReadDstColor) {
134 if (fIsLCD != that.fIsLCD) {
137 return this->onIsEqual(that);
167 bool fWillReadDstColor;
195#pragma GCC diagnostic push
196#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
198#if defined(__clang__)
199#pragma clang diagnostic push
200#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
209 kReadsDstInShader = 0x1,
213 kCompatibleWithCoverageAsAlpha = 0x2,
217 kIgnoresInputColor = 0x4,
222 kRequiresDstTexture = 0x10,
227 kRequiresNonOverlappingDraws = 0x20,
231 kUsesNonCoherentHWBlending = 0x40,
235 kUnaffectedByDstValue = 0x80,
272#pragma GCC diagnostic pop
274#if defined(__clang__)
275#pragma clang diagnostic pop
293 const char* inputColor,
294 const char* inputCoverage,
295 const char* outputPrimary,
296 const char* outputSecondary,
300 : fXPFragBuilder(fragBuilder)
301 , fUniformHandler(uniformHandler)
304 , fInputColor(inputColor ? inputColor :
"half4(1.0)")
305 , fInputCoverage(inputCoverage)
306 , fOutputPrimary(outputPrimary)
307 , fOutputSecondary(outputSecondary)
308 , fDstTextureSamplerHandle(dstTextureSamplerHandle)
309 , fDstTextureOrigin(dstTextureOrigin)
310 , fWriteSwizzle(writeSwizzle) {}
342 const char* srcCoverage,
343 const char* dstColor,
344 const char* outColor,
345 const char* outColorSecondary,
355 SK_ABORT(
"emitOutputsForBlendState not implemented.");
365 const char* srcColor,
366 const char* srcCoverage,
367 const char* dstColor,
368 const char* outColor,
369 const char* outColorSecondary,
371 SK_ABORT(
"emitBlendCodeForDstRead not implemented.");
376 const char* outColor,
377 const char* outColorSecondary)
const;
GrProcessorAnalysisCoverage
#define GR_MAKE_BITFIELD_CLASS_OPS(X)
@ kTexture_GrXferBarrierType
@ kNone_GrXferBarrierType
@ kBlend_GrXferBarrierType
#define SK_ABORT(message,...)
static constexpr bool SkToBool(const T &x)
virtual sk_sp< const GrXferProcessor > makeXferProcessor(const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &, GrClampType) const =0
GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(AnalysisProperties)
static const GrXPFactory * FromBlendMode(SkBlendMode)
static sk_sp< const GrXferProcessor > MakeXferProcessor(const GrXPFactory *, const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &caps, GrClampType)
virtual AnalysisProperties analysisProperties(const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType) const =0
static AnalysisProperties GetAnalysisProperties(const GrXPFactory *, const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType)
virtual ~ProgramImpl()=default
virtual void emitOutputsForBlendState(const EmitArgs &)
virtual void onSetData(const GrGLSLProgramDataManager &, const GrXferProcessor &)
GrGLSLUniformHandler::SamplerHandle SamplerHandle
void emitCode(const EmitArgs &)
virtual void emitBlendCodeForDstRead(GrGLSLXPFragmentBuilder *, GrGLSLUniformHandler *, const char *srcColor, const char *srcCoverage, const char *dstColor, const char *outColor, const char *outColorSecondary, const GrXferProcessor &)
virtual void onAddToKey(const GrShaderCaps &, skgpu::KeyBuilder *) const =0
virtual bool onIsEqual(const GrXferProcessor &) const =0
bool isEqual(const GrXferProcessor &that) const
virtual GrXferBarrierType xferBarrierType(const GrCaps &caps) const
skgpu::BlendInfo getBlendInfo() const
virtual std::unique_ptr< ProgramImpl > makeProgramImpl() const =0
bool willReadDstColor() const
virtual bool onHasSecondaryOutput() const
virtual void onGetBlendInfo(skgpu::BlendInfo *) const
GrSurfaceOrigin fDstTextureOrigin
const GrXferProcessor & fXP
const char * fInputCoverage
const char * fOutputPrimary
const char * fOutputSecondary
EmitArgs(GrGLSLXPFragmentBuilder *fragBuilder, GrGLSLUniformHandler *uniformHandler, const GrShaderCaps *caps, const GrXferProcessor &xp, const char *inputColor, const char *inputCoverage, const char *outputPrimary, const char *outputSecondary, const SamplerHandle dstTextureSamplerHandle, GrSurfaceOrigin dstTextureOrigin, const skgpu::Swizzle &writeSwizzle)
GrGLSLXPFragmentBuilder * fXPFragBuilder
const SamplerHandle fDstTextureSamplerHandle
const GrShaderCaps * fShaderCaps
GrGLSLUniformHandler * fUniformHandler
skgpu::Swizzle fWriteSwizzle