pub struct SvgSubsystem {
pub model_cache: LruCache<String, SvgModel>,
pub tree_cache: LruCache<String, Tree>,
pub filter_engine: Option<FilterEngine>,
pub filter_batches: Vec<FilterNode>,
/* private fields */
}Expand description
Group of caches and engines used for SVG rendering.
Fields§
§model_cache: LruCache<String, SvgModel>LRU cache for tessellated SVG models.
tree_cache: LruCache<String, Tree>LRU cache for parsed usvg::Tree (source representation).
filter_engine: Option<FilterEngine>SVG filter engine. Optional because it may fail to create.
filter_batches: Vec<FilterNode>Pending filter operations for the current frame.
Implementations§
Source§impl SvgSubsystem
impl SvgSubsystem
Sourcepub fn forge(
device: &Arc<Device>,
queue: &Arc<Queue>,
model_cache_capacity: NonZeroUsize,
tree_cache_capacity: NonZeroUsize,
) -> Self
pub fn forge( device: &Arc<Device>, queue: &Arc<Queue>, model_cache_capacity: NonZeroUsize, tree_cache_capacity: NonZeroUsize, ) -> Self
Create an SVG subsystem with the given LRU capacities. The filter engine is created from the device/queue pair and may fail (returning None) on unsupported devices.
Sourcepub fn clear_filter_batches(&mut self)
pub fn clear_filter_batches(&mut self)
Clear the filter batches for the current frame. Called at the start of each frame.
Sourcepub fn mark_element_dirty(&mut self, element_id: &str)
pub fn mark_element_dirty(&mut self, element_id: &str)
Mark a specific SVG element as dirty (needs retessellation).
Sourcepub fn mark_source_dirty(&mut self, source_name: &str)
pub fn mark_source_dirty(&mut self, source_name: &str)
Mark an entire SVG source as dirty (all elements need retessellation).
Sourcepub fn is_element_dirty(&self, element_id: &str) -> bool
pub fn is_element_dirty(&self, element_id: &str) -> bool
Check if a specific element is dirty.
Sourcepub fn is_source_dirty(&self, source_name: &str) -> bool
pub fn is_source_dirty(&self, source_name: &str) -> bool
Check if a source has any dirty elements.
Sourcepub fn clear_dirty(&mut self)
pub fn clear_dirty(&mut self)
Clear all dirty flags. Called after retessellation is complete.
Sourcepub fn dirty_count(&self) -> usize
pub fn dirty_count(&self) -> usize
Return the number of dirty elements.
Auto Trait Implementations§
impl !RefUnwindSafe for SvgSubsystem
impl !UnwindSafe for SvgSubsystem
impl Freeze for SvgSubsystem
impl Send for SvgSubsystem
impl Sync for SvgSubsystem
impl Unpin for SvgSubsystem
impl UnsafeUnpin for SvgSubsystem
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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