SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.
SKBlender represents a custom blend function in the Skia pipeline.
When a blender is present in a paint, the BlendMode property is ignored. A blender combines a source color (the result of our paint) and destination color (from the canvas) into a final color.
Bugs Fixed
None.
API Changes
// NEW TYPES
public unsafe class SKBlender : SKObject, ISKReferenceCounted
{
public static SKBlender CreateBlendMode (SKBlendMode mode);
public static SKBlender CreateArithmetic (float k1, float k2, float k3, float k4, bool enforcePMColor);
}
public class SKRuntimeBlenderBuilder : SKRuntimeEffectBuilder
{
public SKRuntimeBlenderBuilder (SKRuntimeEffect effect);
public SKBlender Build ();
}
// NEW MEMBERS
class SKImageFilter
{
public static SKImageFilter CreateBlendMode (SKBlender blender, SKImageFilter? background);
public static SKImageFilter CreateBlendMode (SKBlender blender, SKImageFilter? background, SKImageFilter? foreground);
public static SKImageFilter CreateBlendMode (SKBlender blender, SKImageFilter? background, SKImageFilter? foreground, SKRect cropRect);
}
class SKPaint
{
public SKBlender Blender { get; set; }
}
class SKRuntimeEffect
{
public SKBlender ToBlender ();
public SKBlender ToBlender (SKRuntimeEffectUniforms uniforms);
public SKBlender ToBlender (SKRuntimeEffectUniforms uniforms, SKRuntimeEffectChildren children);
}
struct SKRuntimeEffectChild
{
public SKRuntimeEffectChild (SKBlender blender);
public SKBlender Blender { get; }
public static implicit operator SKRuntimeEffectChild (SKBlender blender);
}
class SKShader
{
public static SKShader CreateBlend (SKBlendMode mode, SKShader shaderA, SKShader shaderB);
public static SKShader CreateBlend (SKBlender blender, SKShader shaderA, SKShader shaderB);
}
Description of Change
SKBlender
represents a custom blend function in the Skia pipeline.When a blender is present in a paint, the
BlendMode
property is ignored. A blender combines a source color (the result of our paint) and destination color (from the canvas) into a final color.Bugs Fixed
None.
API Changes
Behavioral Changes
None.
Required skia PR
https://github.com/mono/skia/pull/123
PR Checklist