SkPaint paint; paint.setXfermodeMode(SkBlendMode::kSrcOver);
SkBlendMode customBlendMode = SkBlendMode::MakeFunction( [](SkColor src, SkColor dst) -> SkPMColor { SkPMColor srcPM = SkPreMultiplyColor(src); SkPMColor dstPM = SkPreMultiplyColor(dst); return SkAlphaMul(srcPM, SkGetPackedR32(srcPM) * SkGetPackedG32(srcPM) * SkGetPackedB32(srcPM)) + SkAlphaMul(dstPM, SkGetPackedR32(dstPM) * SkGetPackedG32(dstPM) * SkGetPackedB32(dstPM)); }, "customBlendMode"); paint.setXfermodeMode(customBlendMode);The SkPaint class is part of the Skia library, which is an open-source 2D graphics library that is used by many applications and frameworks, including Google Chrome, Firefox, and Android.