Added in API level 1

ComposeShader


open class ComposeShader : Shader

A subclass of shader that returns the composition of two other shaders, combined by an android.graphics.Xfermode subclass.

Summary

Public constructors
ComposeShader(shaderA: Shader, shaderB: Shader, blendMode: BlendMode)

Create a new compose shader, given shaders A, B, and a combining PorterDuff mode.

ComposeShader(shaderA: Shader, shaderB: Shader, mode: PorterDuff.Mode)

Create a new compose shader, given shaders A, B, and a combining PorterDuff mode.

ComposeShader(shaderA: Shader, shaderB: Shader, mode: Xfermode)

Create a new compose shader, given shaders A, B, and a combining mode.

Inherited functions
Boolean getLocalMatrix(localM: Matrix)

Return true if the shader has a non-identity local matrix.

Unit setLocalMatrix(localM: Matrix?)

Set the shader's local matrix. Passing null will reset the shader's matrix to identity. If the matrix has scale value as 0, the drawing result is undefined.

Public constructors

ComposeShader

Added in API level 29
ComposeShader(
    shaderA: Shader,
    shaderB: Shader,
    blendMode: BlendMode)

Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result from shader B as its "src".

Parameters
shaderA Shader: The colors from this shader are seen as the "dst" by the mode This value cannot be null.
shaderB Shader: The colors from this shader are seen as the "src" by the mode This value cannot be null.
blendMode BlendMode: The blend mode that combines the colors from the two shaders. This value cannot be null.

ComposeShader

Added in API level 1
ComposeShader(
    shaderA: Shader,
    shaderB: Shader,
    mode: PorterDuff.Mode)

Create a new compose shader, given shaders A, B, and a combining PorterDuff mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result from shader B as its "src".

Parameters
shaderA Shader: The colors from this shader are seen as the "dst" by the mode This value cannot be null.
shaderB Shader: The colors from this shader are seen as the "src" by the mode This value cannot be null.
mode PorterDuff.Mode: The PorterDuff mode that combines the colors from the two shaders. This value cannot be null.

ComposeShader

Added in API level 1
ComposeShader(
    shaderA: Shader,
    shaderB: Shader,
    mode: Xfermode)

Create a new compose shader, given shaders A, B, and a combining mode. When the mode is applied, it will be given the result from shader A as its "dst", and the result from shader B as its "src".

Parameters
shaderA Shader: The colors from this shader are seen as the "dst" by the mode This value cannot be null.
shaderB Shader: The colors from this shader are seen as the "src" by the mode This value cannot be null.
mode Xfermode: The mode that combines the colors from the two shaders. If mode is null, then SRC_OVER is assumed.