87 , fHWBlendEquation(hwBlendEquation) {}
95 const char*
name()
const override {
return "Custom Xfermode"; }
117 if (this->hasHWBlendEquation()) {
119 b->addBool(
true,
"has hardware blend equation");
122 b->addBool(
false,
"has hardware blend equation");
132 void emitOutputsForBlendState(
const EmitArgs&
args)
override {
149 const char* srcColor,
150 const char* srcCoverage,
151 const char* dstColor,
152 const char* outColor,
153 const char* outColorSecondary,
159 &xp, uniformHandler, &fBlendUniform, srcColor, dstColor, xp.fMode);
160 fragBuilder->
codeAppendf(
"%s = %s;", outColor, blendExpr.c_str());
163 DefaultCoverageModulation(fragBuilder,
173 if (fBlendUniform.isValid()) {
182 return std::make_unique<Impl>();
187 return fMode ==
s.fMode && fHWBlendEquation ==
s.fHWBlendEquation;
198 if (this->hasHWBlendEquation()) {
199 blendInfo->fEquation = fHWBlendEquation;
207#pragma GCC diagnostic push
208#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
210#if defined(__clang__)
211#pragma clang diagnostic push
212#pragma clang diagnostic ignored "-Wnon-virtual-dtor"
238#pragma GCC diagnostic pop
240#if defined(__clang__)
241#pragma clang diagnostic pop
368#if defined(GR_TEST_UTILS)
369const GrXPFactory* CustomXPFactory::TestGet(GrProcessorTestData*
d) {
static constexpr skgpu::BlendEquation hw_blend_equation(SkBlendMode mode)
static bool can_use_hw_blend_equation(skgpu::BlendEquation equation, GrProcessorAnalysisCoverage coverage, const GrCaps &caps)
GrProcessorAnalysisCoverage
#define GR_DECLARE_XP_FACTORY_TEST
#define GR_DEFINE_XP_FACTORY_TEST(...)
@ kNone_GrXferBarrierType
@ kBlend_GrXferBarrierType
@ kExclusion
rc = s + d - two(s*d), ra = kSrcOver
@ kSaturation
saturation of source with hue and luminosity of destination
@ kColorBurn
darken destination to reflect source
@ kLighten
rc = s + d - min(s*da, d*sa), ra = kSrcOver
@ kHue
hue of source with saturation and luminosity of destination
@ kMultiply
r = s*(1-da) + d*(1-sa) + s*d
@ kLastCoeffMode
last porter duff blend mode
@ kColorDodge
brighten destination to reflect source
@ kLastSeparableMode
last blend mode operating separately on components
@ kLuminosity
luminosity of source with hue and saturation of destination
@ kSoftLight
lighten or darken, depending on source
@ kDifference
rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
@ kOverlay
multiply or screen, depending on destination
@ kLastMode
last valid value
@ kColor
hue and saturation of source with luminosity of destination
@ kHardLight
multiply or screen, depending on source
@ kDarken
rc = s + d - max(s*da, d*sa), ra = kSrcOver
constexpr CustomXPFactory(SkBlendMode mode)
std::unique_ptr< ProgramImpl > makeProgramImpl() const override
const char * name() const override
CustomXP(SkBlendMode mode, GrProcessorAnalysisCoverage coverage)
GrXferBarrierType xferBarrierType(const GrCaps &) const override
CustomXP(SkBlendMode mode, skgpu::BlendEquation hwBlendEquation)
bool advancedBlendEquationSupport() const
@ kAdvancedCoherent_BlendEquationSupport
bool advancedCoherentBlendEquationSupport() const
bool isAdvancedBlendEquationDisabled(skgpu::BlendEquation equation) const
BlendEquationSupport blendEquationSupport() const
void codeAppendf(const char format[],...) SK_PRINTF_LIKE(2
virtual void enableAdvancedBlendEquationIfNeeded(skgpu::BlendEquation)=0
@ kCompatibleWithCoverageAsAlpha
@ kUsesNonCoherentHWBlending
@ kRequiresNonOverlappingDraws
GrXferProcessor(ClassID classID)
bool willReadDstColor() const
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
bool IsSupportedMode(SkBlendMode mode)
const GrXPFactory * Get(SkBlendMode mode)
std::string BlendExpression(const GrProcessor *processor, GrGLSLUniformHandler *uniformHandler, GrGLSLProgramDataManager::UniformHandle *blendUniform, const char *srcColor, const char *dstColor, SkBlendMode mode)
int BlendKey(SkBlendMode mode)
void SetBlendModeUniformData(const GrGLSLProgramDataManager &pdman, GrGLSLProgramDataManager::UniformHandle blendUniform, 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
static const int kBlendEquationCnt
AdvBlendEqInteraction fAdvBlendEqInteraction