[][src]Trait azul_webrender::ProfilerHooks

pub trait ProfilerHooks: Send + Sync {
    fn begin_marker(&self, label: &CStr);
fn end_marker(&self, label: &CStr);
fn event_marker(&self, label: &CStr);
fn add_text_marker(&self, label: &CStr, text: &str, duration: Duration);
fn thread_is_being_profiled(&self) -> bool; }

Defines the interface for hooking up an external profiler to WR.

Required methods

fn begin_marker(&self, label: &CStr)

Called at the beginning of a profile scope. The label must be a C string (null terminated).

fn end_marker(&self, label: &CStr)

Called at the end of a profile scope. The label must be a C string (null terminated).

fn event_marker(&self, label: &CStr)

Called to mark an event happening. The label must be a C string (null terminated).

fn add_text_marker(&self, label: &CStr, text: &str, duration: Duration)

Called with a duration to indicate a text marker that just ended. Text markers allow different types of entries to be recorded on the same row in the timeline, by adding labels to the entry.

This variant is also useful when the caller only wants to record events longer than a certain threshold, and thus they don't know in advance whether the event will qualify.

fn thread_is_being_profiled(&self) -> bool

Returns true if the current thread is being profiled.

Loading content...

Implementors

Loading content...