pub enum RenderEffect {
Blur {
radius_x: f32,
radius_y: f32,
edge_treatment: TileMode,
},
Offset {
offset_x: f32,
offset_y: f32,
},
Shader {
shader: RuntimeShader,
},
Chain {
first: Box<RenderEffect>,
second: Box<RenderEffect>,
},
}Expand description
A render effect applied to a graphics layer’s rendered content.
Matches Jetpack Compose’s RenderEffect sealed class hierarchy,
extended with Shader for custom WGSL effects.
Variants§
Blur
Gaussian blur applied to the layer’s rendered content.
Offset
Offset the rendered content by a fixed amount.
Shader
Apply a custom WGSL shader effect.
Fields
§
shader: RuntimeShaderChain
Chain two effects: apply first, then apply second to the result.
Implementations§
Source§impl RenderEffect
impl RenderEffect
Sourcepub fn blur_with_edge_treatment(radius: f32, edge_treatment: TileMode) -> Self
pub fn blur_with_edge_treatment(radius: f32, edge_treatment: TileMode) -> Self
Create a blur effect with equal radius in both directions and explicit edge treatment semantics.
Sourcepub fn blur_xy(radius_x: f32, radius_y: f32, edge_treatment: TileMode) -> Self
pub fn blur_xy(radius_x: f32, radius_y: f32, edge_treatment: TileMode) -> Self
Create a blur effect with separate horizontal and vertical radii.
Sourcepub fn runtime_shader(shader: RuntimeShader) -> Self
pub fn runtime_shader(shader: RuntimeShader) -> Self
Create a custom shader effect from a RuntimeShader.
Sourcepub fn then(self, other: RenderEffect) -> Self
pub fn then(self, other: RenderEffect) -> Self
Chain this effect with another: self is applied first, then other.
Trait Implementations§
Source§impl Clone for RenderEffect
impl Clone for RenderEffect
Source§fn clone(&self) -> RenderEffect
fn clone(&self) -> RenderEffect
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RenderEffect
impl Debug for RenderEffect
Source§impl PartialEq for RenderEffect
impl PartialEq for RenderEffect
impl StructuralPartialEq for RenderEffect
Auto Trait Implementations§
impl Freeze for RenderEffect
impl RefUnwindSafe for RenderEffect
impl Send for RenderEffect
impl Sync for RenderEffect
impl Unpin for RenderEffect
impl UnsafeUnpin for RenderEffect
impl UnwindSafe for RenderEffect
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more