Enum webrender::picture::PictureCompositeMode
source · 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_svgfe(
&self,
filters: &[(FilterGraphNode, FilterGraphOp)],
surface_rect: LayoutRect,
surface_rect_is_source: bool,
skip_subregion_clips: bool,
) -> (LayoutRect, LayoutRect, LayoutRect)
pub fn get_coverage_svgfe( &self, filters: &[(FilterGraphNode, FilterGraphOp)], surface_rect: LayoutRect, surface_rect_is_source: bool, skip_subregion_clips: bool, ) -> (LayoutRect, LayoutRect, LayoutRect)
Here we compute the source and target rects for SVGFEGraph by walking the whole graph and propagating subregions based on the provided invalidation rect (in either source or target space), 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_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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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