struct FrameDelayer {
image_epochs: HashMap<ImageKey, Epoch>,
pending_canvas_images: HashMap<ImageKey, Epoch>,
pending_frame: bool,
waiting_pipelines: HashSet<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: HashMap<ImageKey, Epoch>
The latest Epoch
of canvas images that have been sent to WebRender. Note
that this only records the Epoch
s for canvases and only ones that are involved
in “update the rendering”.
pending_canvas_images: HashMap<ImageKey, Epoch>
A map of all pending canvas images
pending_frame: bool
Whether or not we have a pending frame.
waiting_pipelines: HashSet<PipelineId>
A list of pipelines that should be notified when we are no longer waiting for canvas images.
Implementations§
Source§impl FrameDelayer
impl FrameDelayer
fn delete_image(&mut self, image_key: ImageKey)
fn update_image(&mut self, image_key: ImageKey, epoch: Epoch)
fn add_delay( &mut self, pipeline_id: PipelineId, canvas_epoch: Epoch, image_keys: Vec<ImageKey>, )
fn needs_new_frame(&self) -> bool
fn set_pending_frame(&mut self, value: bool)
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
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.