LithoRenderEffect

sealed class LithoRenderEffect

A Litho abstraction of RenderEffect. Android RenderEffect is a wrapper for native code, which means that the instances are never equal and if we pass such instances through Litho, it may break some of our optimizations which rely on object equivalence.

See RenderEffect

Inheritors

Types

Link copied to clipboard
@RequiresApi(value = 31)
data class Bitmap(val bitmap: Bitmap, val src: Rect? = null, val dst: Rect? = null) : LithoRenderEffect

A LithoRenderEffect that renders the contents of the input android.graphics.Bitmap. This is useful to create an input for other LithoRenderEffect types such as Blur or ColorFilter.

Link copied to clipboard
@RequiresApi(value = 31)
data class BlendMode(val dst: LithoRenderEffect, val src: LithoRenderEffect, val blendMode: BlendMode) : LithoRenderEffect

A LithoRenderEffect that is a composition of 2 other LithoRenderEffect instances combined by the specified android.graphics.BlendMode

Link copied to clipboard
@RequiresApi(value = 31)
data class Blur(val radiusX: Float, val radiusY: Float, val edgeTreatment: Shader.TileMode, val inputEffect: LithoRenderEffect? = null) : LithoRenderEffect

A LithoRenderEffect that blurs the contents of the optional input RenderEffect with the specified radius along the x and y axis. If no input LithoRenderEffect is provided then all drawing commands issued with a android.graphics.RenderNode that this LithoRenderEffect is installed in will be blurred

Link copied to clipboard
@RequiresApi(value = 31)
data class Chain(val outer: LithoRenderEffect, val inner: LithoRenderEffect) : LithoRenderEffect

A LithoRenderEffect that composes inner with outer, such that the results of inner are treated as the source bitmap passed to outer, i.e.

Link copied to clipboard
@RequiresApi(value = 31)
data class ColorFilter(val colorFilter: ColorFilter, val renderEffect: LithoRenderEffect? = null) : LithoRenderEffect

A LithoRenderEffect that applies the color filter to the provided LithoRenderEffect

Link copied to clipboard
@RequiresApi(value = 31)
data class Offset(val offsetX: Float, val offsetY: Float, val input: LithoRenderEffect? = null) : LithoRenderEffect

A LithoRenderEffect instance that will offset the drawing content by the provided x and y offset.

Link copied to clipboard
@RequiresApi(value = 33)
data class RuntimeShader(val shader: RuntimeShader, val uniformShaderName: String) : LithoRenderEffect

A LithoRenderEffect that executes the provided android.graphics.RuntimeShader and passes the contents of the android.graphics.RenderNode that this LithoRenderEffect is installed on as an input to the shader.

Link copied to clipboard
@RequiresApi(value = 31)
data class Shader(val shader: Shader) : LithoRenderEffect

A LithoRenderEffect that renders the contents of the input android.graphics.Shader. This is useful to create an input for other LithoRenderEffect types such as Blur or ColorFilter.

Functions

Link copied to clipboard

Creates a RenderEffect instance from this LithoRenderEffect.