pub struct BrowserRenderTimer { /* private fields */ }Expand description
A render timer that ticks with the animation frames of the thread it is started on: the page, or the worker of a render thread.
Implementations§
Source§impl BrowserRenderTimer
impl BrowserRenderTimer
Sourcepub fn new(is_background: bool) -> Arc<Self> ⓘ
pub fn new(is_background: bool) -> Arc<Self> ⓘ
Creates the timer. is_background tells whether its ticks arrive on
a thread other than the UI thread: such a timer is started by the
thread that renders, with
start_on_this_thread.
Sourcepub fn start_on_this_thread(&self)
pub fn start_on_this_thread(&self)
Starts following the animation frames on the current thread. Does nothing when the timer is started already.
The thread has to live for as long as the timer is used: its frames arrive at the event loop of its worker, and so does a tick out of turn.
Trait Implementations§
Source§impl IRenderTimer for BrowserRenderTimer
impl IRenderTimer for BrowserRenderTimer
Source§fn request_tick_out_of_turn(&self)
fn request_tick_out_of_turn(&self)
Queues one tick for the thread the timer was started on, which runs it from its event loop without waiting for its next animation frame. Requests made before that tick has started are one request. The timestamp of the tick is read from the clock of the animation frames of that thread.
A request made to a background timer that is not started yet is kept: the thread that starts the timer ticks once when it does. (The thread of the page asks before it waits for a frame, and the render thread it started a moment ago may not have got that far.)
Does nothing when the caller is the thread that ticks (it cannot be waiting for itself), while no callback is set, and in a build without threads.
Source§fn tick(&self) -> Option<RenderTimerTick>
fn tick(&self) -> Option<RenderTimerTick>
Source§fn set_tick(&self, value: Option<RenderTimerTick>)
fn set_tick(&self, value: Option<RenderTimerTick>)
Source§fn runs_in_background(&self) -> bool
fn runs_in_background(&self) -> bool
Auto Trait Implementations§
impl !Freeze for BrowserRenderTimer
impl RefUnwindSafe for BrowserRenderTimer
impl Send for BrowserRenderTimer
impl Sync for BrowserRenderTimer
impl Unpin for BrowserRenderTimer
impl UnsafeUnpin for BrowserRenderTimer
impl UnwindSafe for BrowserRenderTimer
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<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more