pub struct RenderingMetricsCollector { /* private fields */ }
Expand description
Helper class that rendering backends can use to provide an FPS counter
Implementations
sourceimpl RenderingMetricsCollector
impl RenderingMetricsCollector
sourcepub fn new(window: Weak<Window>) -> Option<Rc<Self>>
pub fn new(window: Weak<Window>) -> 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: &mut dyn ItemRenderer)
pub fn measure_frame_rendered(self: &Rc<Self>, renderer: &mut dyn ItemRenderer)
Call this function every time you’ve completed the rendering of a frame. The rendere parameter is used to collect additional data and is used to render an overlay if enabled.
Auto Trait Implementations
impl !RefUnwindSafe for RenderingMetricsCollector
impl !Send for RenderingMetricsCollector
impl !Sync for RenderingMetricsCollector
impl Unpin for RenderingMetricsCollector
impl !UnwindSafe for RenderingMetricsCollector
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