pub enum PictureCompositeMode {
    MixBlend(MixBlendMode),
    Filter(Filter),
    ComponentTransferFilter(Handle<FilterDataIntern>),
    Blit(BlitReason),
    TileCache {
        slice_id: SliceId,
    },
    SvgFilter(Vec<FilterPrimitive>, Vec<SFilterData>),
    SVGFEGraph(Vec<(FilterGraphNode, FilterGraphOp)>),
    IntermediateSurface,
}Expand description
Specifies how this Picture should be composited onto the target it belongs to.
Variants§
MixBlend(MixBlendMode)
Apply CSS mix-blend-mode effect.
Filter(Filter)
Apply a CSS filter (except component transfer).
ComponentTransferFilter(Handle<FilterDataIntern>)
Apply a component transfer filter.
Blit(BlitReason)
Draw to intermediate surface, copy straight across. This is used for CSS isolation, and plane splitting.
TileCache
Used to cache a picture as a series of tiles.
SvgFilter(Vec<FilterPrimitive>, Vec<SFilterData>)
Apply an SVG filter
SVGFEGraph(Vec<(FilterGraphNode, FilterGraphOp)>)
Apply an SVG filter graph
IntermediateSurface
A surface that is used as an input to another primitive
Implementations§
Source§impl PictureCompositeMode
 
impl PictureCompositeMode
pub fn get_rect( &self, surface: &SurfaceInfo, sub_rect: Option<LayoutRect>, ) -> LayoutRect
pub fn get_coverage( &self, surface: &SurfaceInfo, sub_rect: Option<LayoutRect>, ) -> LayoutRect
Sourcepub fn kind(&self) -> &'static str
 
pub fn kind(&self) -> &'static str
Returns a static str describing the type of PictureCompositeMode (and filter type if applicable)
Sourcepub fn get_coverage_target_svgfe(
    &self,
    filters: &[(FilterGraphNode, FilterGraphOp)],
    surface_rect: LayoutRect,
) -> LayoutRect
 
pub fn get_coverage_target_svgfe( &self, filters: &[(FilterGraphNode, FilterGraphOp)], surface_rect: LayoutRect, ) -> LayoutRect
Here we transform source rect to target rect for SVGFEGraph by walking the whole graph and propagating subregions based on the provided invalidation rect, and we want it to be a tight fit so we don’t waste time applying multiple filters to pixels that do not contribute to the invalidated rect.
The interesting parts of the handling of SVG filters are:
- scene_building.rs : wrap_prim_with_filters
 - picture.rs : get_coverage_target_svgfe (you are here)
 - picture.rs : get_coverage_source_svgfe
 - render_task.rs : new_svg_filter_graph
 - render_target.rs : add_svg_filter_node_instances
 
Sourcepub fn get_coverage_source_svgfe(
    &self,
    filters: &[(FilterGraphNode, FilterGraphOp)],
    surface_rect: LayoutRect,
) -> LayoutRect
 
pub fn get_coverage_source_svgfe( &self, filters: &[(FilterGraphNode, FilterGraphOp)], surface_rect: LayoutRect, ) -> LayoutRect
Here we transform target rect to source rect for SVGFEGraph by walking the whole graph and propagating subregions based on the provided invalidation rect, and we want it to be a tight fit so we don’t waste time applying multiple filters to pixels that do not contribute to the invalidated rect.
The interesting parts of the handling of SVG filters are:
- scene_building.rs : wrap_prim_with_filters
 - picture.rs : get_coverage_target_svgfe
 - picture.rs : get_coverage_source_svgfe (you are here)
 - render_task.rs : new_svg_filter_graph
 - render_target.rs : add_svg_filter_node_instances
 
Trait Implementations§
Source§impl Clone for PictureCompositeMode
 
impl Clone for PictureCompositeMode
Source§fn clone(&self) -> PictureCompositeMode
 
fn clone(&self) -> PictureCompositeMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PictureCompositeMode
 
impl Debug for PictureCompositeMode
Auto Trait Implementations§
impl Freeze for PictureCompositeMode
impl RefUnwindSafe for PictureCompositeMode
impl Send for PictureCompositeMode
impl Sync for PictureCompositeMode
impl Unpin for PictureCompositeMode
impl UnwindSafe for PictureCompositeMode
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more