Table of Contents

Class ShaderDoubleTexturesEffect

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll

Base shader effect class that has 2 input textures.

public class ShaderDoubleTexturesEffect : SkiaShaderEffect, INotifyPropertyChanged, IDisposable, IPostRendererEffect, ISkiaEffect, ICanBeUpdatedWithContext, ICanBeUpdated
Inheritance
ShaderDoubleTexturesEffect
Implements
Inherited Members
Extension Methods

Fields

AssignedControlTo

protected SkiaControl AssignedControlTo

Field Value

SkiaControl

ControlFromProperty

public static readonly BindableProperty ControlFromProperty

Field Value

BindableProperty

ControlToProperty

public static readonly BindableProperty ControlToProperty

Field Value

BindableProperty

LoadedSecondaryBitmap

protected SKBitmap LoadedSecondaryBitmap

Field Value

SKBitmap

PrimarySourceProperty

public static readonly BindableProperty PrimarySourceProperty

Field Value

BindableProperty

SecondarySourceProperty

public static readonly BindableProperty SecondarySourceProperty

Field Value

BindableProperty

SecondaryTexture

Will be normally set by CompileSecondaryTexture

protected SKShader SecondaryTexture

Field Value

SKShader

TilingSecondaryTexture

protected SKShaderTileMode TilingSecondaryTexture

Field Value

SKShaderTileMode

Properties

ControlFrom

public SkiaControl ControlFrom { get; set; }

Property Value

SkiaControl

ControlTo

public SkiaControl ControlTo { get; set; }

Property Value

SkiaControl

LoadedPrimaryBitmap

protected SKBitmap LoadedPrimaryBitmap { get; set; }

Property Value

SKBitmap

PrimarySource

public string PrimarySource { get; set; }

Property Value

string

ResizedPrimaryImage

Loaded from file

protected SKImage ResizedPrimaryImage { get; set; }

Property Value

SKImage

SecondarySource

public string SecondarySource { get; set; }

Property Value

string

Methods

ApplyControlTo(SkiaControl)

protected virtual void ApplyControlTo(SkiaControl control)

Parameters

control SkiaControl

CompileSecondaryTexture(SKImage)

public void CompileSecondaryTexture(SKImage image)

Parameters

image SKImage

CreateTexturesUniforms(SkiaDrawingContext, SKRect, SKShader)

Creates texture uniforms fresh each time

protected override SKRuntimeEffectChildren CreateTexturesUniforms(SkiaDrawingContext ctx, SKRect destination, SKShader primaryTexture)

Parameters

ctx SkiaDrawingContext
destination SKRect
primaryTexture SKShader

Returns

SKRuntimeEffectChildren

GetPrimaryTextureImage(SkiaDrawingContext, SKRect)

Returns the background texture according to the current UseBackground mode. Always — live snapshot (or parent cache) every frame. Once — snapshot taken on first call, frozen thereafter; reset AquiredBackground to re-capture. Never — returns null; shader must not require iImage1.

protected override SKImage GetPrimaryTextureImage(SkiaDrawingContext ctx, SKRect destination)

Parameters

ctx SkiaDrawingContext
destination SKRect

Returns

SKImage

GetSecondaryTexture()

protected virtual SKShader GetSecondaryTexture()

Returns

SKShader

ImportCacheTo()

protected virtual void ImportCacheTo()

LoadPrimarySource(string)

Loading from local files only

public Task LoadPrimarySource(string fileName)

Parameters

fileName string

Returns

Task

LoadSecondarySource(string)

Loading from local files only

public Task LoadSecondarySource(string fileName)

Parameters

fileName string

Returns

Task

OnDisposing()

Simplified dispose - only CPU-side resources

protected override void OnDisposing()

ParentReady()

protected bool ParentReady()

Returns

bool

ResizePrimaryLoadedBitmap()

public void ResizePrimaryLoadedBitmap()

ResizeSecondaryLoadedBitmapAndCompileTexture()

public void ResizeSecondaryLoadedBitmapAndCompileTexture()

ShouldDisposePreviousTexture(SKImage)

Checks if image is a new snapshot that needs disposal this frame. Frozen snapshots are managed by ReleaseFrozenSnapshot; parent cache is never owned.

protected override bool ShouldDisposePreviousTexture(SKImage image)

Parameters

image SKImage

Returns

bool