21#define RETURN_SINGLETON_BLENDER(m) \
23 static SkNoDestructor<SkBlendModeBlender> sBlender(m); \
24 return sk_ref_sp(sBlender.get()); \
62#undef RETURN_SINGLETON_BLENDER
71 buffer.writeInt((
int)fMode);
#define SkDEBUGFAILF(fmt,...)
#define RETURN_SINGLETON_BLENDER(m)
void SkBlendMode_AppendStages(SkBlendMode mode, SkRasterPipeline *p)
SK_API bool SkBlendMode_AsCoeff(SkBlendMode mode, SkBlendModeCoeff *src, SkBlendModeCoeff *dst)
@ 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
@ kColorDodge
brighten destination to reflect source
@ kSrcOver
r = s + (1-sa)*d
@ kXor
r = s*(1-da) + d*(1-sa)
@ 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
@ kSrcATop
r = s*da + d*(1-sa)
@ kDstATop
r = d*sa + s*(1-da)
@ kDstOver
r = d + (1-da)*s
@ 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
void flatten(SkWriteBuffer &buffer) const override
bool onAppendStages(const SkStageRec &rec) const override
bool affectsTransparentBlack() const
virtual std::optional< SkBlendMode > asBlendMode() const
static sk_sp< SkBlender > Mode(SkBlendMode mode)
static const uint8_t buffer[]
SkRasterPipeline * fPipeline