1- use crate :: { Glyph , NormalizedCoord , Paint , PaintRef , PaintScene , RenderContext } ;
1+ use std:: sync:: Arc ;
2+
3+ use crate :: { Filter , Glyph , NormalizedCoord , Paint , PaintRef , PaintScene , RenderContext } ;
24use kurbo:: { Affine , BezPath , Rect , Shape , Stroke } ;
35use peniko:: { BlendMode , Color , Fill , FontData , Style , StyleRef } ;
46
@@ -58,6 +60,8 @@ pub struct LayerCommand {
5860 pub transform : Affine ,
5961 #[ cfg_attr( feature = "serde" , serde( with = "svg_path" ) ) ]
6062 pub clip : BezPath , // TODO: more shape options
63+ pub filter : Option < Arc < Filter > > ,
64+ pub backdrop_filter : Option < Arc < Filter > > ,
6165}
6266
6367/// Pushes a new clip layer clipped by the specified shape.
@@ -178,6 +182,8 @@ impl PaintScene for Scene {
178182 alpha : f32 ,
179183 transform : Affine ,
180184 clip : & impl Shape ,
185+ filter : Option < Arc < Filter > > ,
186+ backdrop_filter : Option < Arc < Filter > > ,
181187 ) {
182188 let blend = blend. into ( ) ;
183189 let clip = clip. into_path ( self . tolerance ) ;
@@ -186,6 +192,8 @@ impl PaintScene for Scene {
186192 alpha,
187193 transform,
188194 clip,
195+ filter,
196+ backdrop_filter,
189197 } ;
190198 self . commands . push ( RenderCommand :: PushLayer ( layer) ) ;
191199 }
0 commit comments