Struct i_slint_core::graphics::FPSCounter
source · [−]pub struct FPSCounter { /* private fields */ }
Expand description
Helper class that rendering backends can use to provide an FPS counter
Implementations
sourceimpl FPSCounter
impl FPSCounter
sourcepub fn new() -> Option<Rc<Self>>
pub fn new() -> Option<Rc<Self>>
Returns a new instance of the counter if requested by the user (via SLINT_DEBUG_PERFORMANCE
environment variable).
The environment variable holds a comma separated list of options:
* refresh_lazy
: selects the lazy refresh mode, where measurements are only taken when a frame is rendered (due to user input or animations)
* refresh_full_speed
: frames are continuously rendered
* console
: the measurement is printed to the console
* overlay
: the measurement is drawn as overlay on top of the scene
sourcepub fn start(self: &Rc<Self>, winsys_info: &str)
pub fn start(self: &Rc<Self>, winsys_info: &str)
Call this function if you want to start measurements. This will also print out some system information such as whether this is a debug or release build, as well as the provided winsys_info string.
sourcepub fn measure_frame_rendered(
self: &Rc<Self>,
renderer_for_overlay: &mut dyn ItemRenderer
)
pub fn measure_frame_rendered(
self: &Rc<Self>,
renderer_for_overlay: &mut dyn ItemRenderer
)
Call this function every time you’ve completed the rendering of a frame.
Auto Trait Implementations
impl !RefUnwindSafe for FPSCounter
impl Send for FPSCounter
impl !Sync for FPSCounter
impl Unpin for FPSCounter
impl UnwindSafe for FPSCounter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more