pub(crate) struct FrameDelayer {
image_epochs: FxHashMap<ImageKey, Epoch>,
pending_canvas_images: FxHashMap<ImageKey, Epoch>,
pub(crate) pending_frame: bool,
waiting_pipelines: FxHashSet<PipelineId>,
}Expand description
A struct that is reponsible for delaying frame requests until all new canvas images
for a particular “update the rendering” call in the ScriptThread have been
sent to WebRender.
These images may be updated in WebRender asynchronously in the canvas task. A frame is then requested if:
- The renderer has received a GenerateFrame message from a
ScriptThread. - All pending image updates have finished and have been noted in the
FrameDelayer.
Fields§
§image_epochs: FxHashMap<ImageKey, Epoch>The latest Epoch of canvas images that have been sent to WebRender. Note
that this only records the Epochs for canvases and only ones that are involved
in “update the rendering”.
pending_canvas_images: FxHashMap<ImageKey, Epoch>A map of all pending canvas images
pending_frame: boolWhether or not we have a pending frame.
waiting_pipelines: FxHashSet<PipelineId>A list of pipelines that should be notified when we are no longer waiting for canvas images.
Implementations§
Source§impl FrameDelayer
impl FrameDelayer
pub(crate) fn delete_image(&mut self, image_key: ImageKey)
pub(crate) fn update_image(&mut self, image_key: ImageKey, epoch: Epoch)
pub(crate) fn add_delay( &mut self, pipeline_id: PipelineId, canvas_epoch: Epoch, image_keys: Vec<ImageKey>, )
pub(crate) fn needs_new_frame(&self) -> bool
pub(crate) fn set_pending_frame(&mut self, value: bool)
pub(crate) fn take_waiting_pipelines(&mut self) -> Vec<PipelineId> ⓘ
Trait Implementations§
Source§impl Default for FrameDelayer
impl Default for FrameDelayer
Source§fn default() -> FrameDelayer
fn default() -> FrameDelayer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FrameDelayer
impl RefUnwindSafe for FrameDelayer
impl Send for FrameDelayer
impl Sync for FrameDelayer
impl Unpin for FrameDelayer
impl UnwindSafe for FrameDelayer
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert