25 , fWillReadDstColor(
false)
31 , fWillReadDstColor(willReadDstColor)
44 bool usesInputAttachmentForDstRead)
const {
47 if (originIfDstTexture) {
52 if (usesInputAttachmentForDstRead) {
121 const char* srcCoverage,
123 if (srcCoverage && proc.
isLCD()) {
124 fragBuilder->
codeAppendf(
"%s.a = max(max(%s.r, %s.g), %s.b);",
133 if (!
args.fXP.willReadDstColor()) {
135 this->emitOutputsForBlendState(
args);
139 const char* dstColor = fragBuilder->
dstColor();
141 bool needsLocalOutColor =
false;
143 if (
args.fDstTextureSamplerHandle.isValid()) {
144 if (
args.fInputCoverage) {
154 fragBuilder->
codeAppendf(
"if (all(lessThanEqual(%s.rgb, half3(0)))) {"
157 args.fInputCoverage);
160 needsLocalOutColor =
args.fShaderCaps->fRequiresLocalOutputColorForFBFetch;
163 const char* outColor =
"_localColorOut";
164 if (!needsLocalOutColor) {
165 outColor =
args.fOutputPrimary;
170 this->emitBlendCodeForDstRead(fragBuilder,
176 args.fOutputSecondary,
178 if (needsLocalOutColor) {
184 this->emitWriteSwizzle(
args.fXPFragBuilder,
187 args.fOutputSecondary);
192 const char* outColor,
193 const char* outColorSecondary)
const {
195 x->codeAppendf(
"%s = %s.%s;", outColor, outColor, swizzle.
asString().
c_str());
196 if (outColorSecondary) {
197 x->codeAppendf(
"%s = %s.%s;",
210 const char* srcCoverage,
211 const char* dstColor,
212 const char* outColor,
213 const char* outColorSecondary,
217 fragBuilder->
codeAppendf(
"half3 lerpRGB = mix(%s.aaa, %s.aaa, %s.rgb);",
222 fragBuilder->
codeAppendf(
"%s = %s * %s + (half4(1.0) - %s) * %s;",
229 fragBuilder->
codeAppendf(
"%s.a = max(max(lerpRGB.r, lerpRGB.b), lerpRGB.g);", outColor);
GrProcessorAnalysisCoverage
@ kTopLeft_GrSurfaceOrigin
static void adjust_for_lcd_coverage(GrGLSLXPFragmentBuilder *fragBuilder, const char *srcCoverage, const GrXferProcessor &proc)
GrXferProcessor::ProgramImpl ProgramImpl
SK_API bool SkBlendMode_AsCoeff(SkBlendMode mode, SkBlendModeCoeff *src, SkBlendModeCoeff *dst)
const GrShaderCaps * shaderCaps() const
void setData(const GrGLSLProgramDataManager &pdman, const GrFragmentProcessor &processor)
virtual void onSetData(const GrGLSLProgramDataManager &, const GrFragmentProcessor &)
virtual void emitCode(EmitArgs &)=0
void codeAppendf(const char format[],...) SK_PRINTF_LIKE(2
virtual const char * dstColor()=0
static sk_sp< const GrXferProcessor > MakeSrcOverXferProcessor(const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &)
static const GrXPFactory * Get(SkBlendMode blendMode)
static AnalysisProperties SrcOverAnalysisProperties(const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage &, const GrCaps &, GrClampType)
virtual sk_sp< const GrXferProcessor > makeXferProcessor(const GrProcessorAnalysisColor &, GrProcessorAnalysisCoverage, const GrCaps &, GrClampType) const =0
static const GrXPFactory * FromBlendMode(SkBlendMode)
@ kCompatibleWithCoverageAsAlpha
@ kRequiresNonOverlappingDraws
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 void onAddToKey(const GrShaderCaps &, skgpu::KeyBuilder *) const =0
bool hasSecondaryOutput() const
GrXferProcessor(ClassID classID)
bool willReadDstColor() const
void addToKey(const GrShaderCaps &, skgpu::KeyBuilder *, const GrSurfaceOrigin *originIfDstTexture, bool usesInputAttachmentForDstRead) const
virtual bool onHasSecondaryOutput() const
const char * c_str() const
SkString asString() const
static constexpr Swizzle RGBA()
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
bool IsSupportedMode(SkBlendMode mode)
const GrXPFactory * Get(SkBlendMode mode)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
bool fDstReadInShaderSupport