pub struct ThrottledPipeline<P> { /* private fields */ }Expand description
Defers frames that arrive sooner than a target rate.
Changes only should_render and forwards every
other pass to the pipeline it wraps, so the wrapped pipeline draws exactly as it
would have. Wrap the standard pipeline to cap an application’s frame rate, or
wrap another decorator — .max_fps(30) reads the same on an
InstrumentedPipeline as on a
StandardImmediatePipeline.
A deferred frame is not a dropped one. It leaves the window dirty and leaves
what the frame would have done pending, so the next frame draws it — including
when the platform asks for a frame on its own, which it does while the window is
dirty. Deferring does not need to schedule that next frame: should_render is
asked before a frame’s work starts, with no window to schedule one with.
Implementations§
Source§impl<P> ThrottledPipeline<P>
impl<P> ThrottledPipeline<P>
Trait Implementations§
Source§impl<P: FramePipeline> FramePipeline for ThrottledPipeline<P>
impl<P: FramePipeline> FramePipeline for ThrottledPipeline<P>
Source§fn should_render(&mut self, is_dirty: bool, metrics: &WindowMetrics) -> bool
fn should_render(&mut self, is_dirty: bool, metrics: &WindowMetrics) -> bool
Source§fn begin_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
fn begin_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
Source§fn evaluate_roots(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
) -> PreparedRoots
fn evaluate_roots( &mut self, window: &mut Window<'_>, cx: &mut App, ) -> PreparedRoots
Source§fn layout_roots(
&mut self,
window: &mut Window<'_>,
roots: &mut PreparedRoots,
cx: &mut App,
)
fn layout_roots( &mut self, window: &mut Window<'_>, roots: &mut PreparedRoots, cx: &mut App, )
roots, then hit tests the pointer against what
they registered. Read moreSource§fn paint_roots(
&mut self,
window: &mut Window<'_>,
roots: PreparedRoots,
cx: &mut App,
)
fn paint_roots( &mut self, window: &mut Window<'_>, roots: PreparedRoots, cx: &mut App, )
roots, in the order they stack.Source§fn finish_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
fn finish_frame(&mut self, window: &mut Window<'_>, cx: &mut App)
Source§fn complete_frame(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
) -> Option<FocusId>
fn complete_frame( &mut self, window: &mut Window<'_>, cx: &mut App, ) -> Option<FocusId>
Source§fn end_frame(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
focus_before_listeners: Option<FocusId>,
)
fn end_frame( &mut self, window: &mut Window<'_>, cx: &mut App, focus_before_listeners: Option<FocusId>, )
Auto Trait Implementations§
impl<P> Freeze for ThrottledPipeline<P>where
P: Freeze,
impl<P> RefUnwindSafe for ThrottledPipeline<P>where
P: RefUnwindSafe,
impl<P> Send for ThrottledPipeline<P>where
P: Send,
impl<P> Sync for ThrottledPipeline<P>where
P: Sync,
impl<P> Unpin for ThrottledPipeline<P>where
P: Unpin,
impl<P> UnsafeUnpin for ThrottledPipeline<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for ThrottledPipeline<P>where
P: UnwindSafe,
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<P> FramePipelineExt for Pwhere
P: FramePipeline,
impl<P> FramePipelineExt for Pwhere
P: FramePipeline,
Source§fn max_fps(self, max_fps: u32) -> ThrottledPipeline<Self>
fn max_fps(self, max_fps: u32) -> ThrottledPipeline<Self>
max_fps frames a second. Read moreSource§fn instrumented(
self,
metrics: Rc<RefCell<PhaseMetrics>>,
) -> InstrumentedPipeline<Self>
fn instrumented( self, metrics: Rc<RefCell<PhaseMetrics>>, ) -> InstrumentedPipeline<Self>
metrics. Read moreSource§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