pub enum SourceFrameCache {
Gpu(FrameStore<GpuSource>),
Cpu(FrameStore<CpuSource>),
}Expand description
Prepared frames for whichever renderer runs. Decoded source frames prepared for one renderer, kept within a byte budget: what an export or a preview renders from.
Variants§
Gpu(FrameStore<GpuSource>)
Frames uploaded for the GPU renderer.
Cpu(FrameStore<CpuSource>)
Frames converted for the CPU renderer.
Implementations§
Source§impl SourceFrameCache
impl SourceFrameCache
Sourcepub fn for_renderer(renderer: ExportRenderer<'_>, bytes: u64) -> Self
pub fn for_renderer(renderer: ExportRenderer<'_>, bytes: u64) -> Self
An empty cache for renderer, keeping up to bytes of frames.
Sourcepub fn follow(&mut self, budget: &FrameBudget, held: u64)
pub fn follow(&mut self, budget: &FrameBudget, held: u64)
Sets the cache’s budget to budget less the held bytes the sources keep, evicting at once
to fit. It never goes below the last output frame’s working set, so a budget lowered under
memory pressure still lets the next frame of the same shape render.
Sourcepub fn provider(&self) -> &dyn FrameProvider
pub fn provider(&self) -> &dyn FrameProvider
The frames, for the renderer.
Sourcepub fn fill(
&mut self,
renderer: ExportRenderer<'_>,
size: RenderSize,
color: ColorPolicy,
(index, needs): (u64, &[FrameNeed]),
sources: &mut dyn SourceFrames,
cancel: &CancelToken,
) -> Result<(), ExportError>
pub fn fill( &mut self, renderer: ExportRenderer<'_>, size: RenderSize, color: ColorPolicy, (index, needs): (u64, &[FrameNeed]), sources: &mut dyn SourceFrames, cancel: &CancelToken, ) -> Result<(), ExportError>
Decodes and prepares every frame needs (of output frame index) names that the cache
does not hold, and keeps them until Self::unpin.
§Errors
A source that cannot be decoded or prepared, or one past the budget.
Sourcepub fn unpin(&mut self)
pub fn unpin(&mut self)
Lets the frames the last Self::fill kept go when the budget needs room.
Auto Trait Implementations§
impl !RefUnwindSafe for SourceFrameCache
impl !UnwindSafe for SourceFrameCache
impl Forget for SourceFrameCache
impl Freeze for SourceFrameCache
impl Move for SourceFrameCache
impl Send for SourceFrameCache
impl Sync for SourceFrameCache
impl Unpin for SourceFrameCache
impl UnsafeUnpin for SourceFrameCache
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> 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