Trait webrender::renderer::init::SceneBuilderHooks

source ·
pub trait SceneBuilderHooks {
    // Required methods
    fn register(&self);
    fn pre_scene_build(&self);
    fn pre_scene_swap(&self);
    fn post_scene_swap(&self, document_id: &Vec<DocumentId>, info: PipelineInfo);
    fn post_resource_update(&self, document_ids: &Vec<DocumentId>);
    fn post_empty_scene_build(&self);
    fn poke(&self);
    fn deregister(&self);
}
Expand description

Allows callers to hook in at certain points of the async scene build. These functions are all called from the scene builder thread.

Required Methods§

source

fn register(&self)

This is called exactly once, when the scene builder thread is started and before it processes anything.

source

fn pre_scene_build(&self)

This is called before each scene build starts.

source

fn pre_scene_swap(&self)

This is called before each scene swap occurs.

source

fn post_scene_swap(&self, document_id: &Vec<DocumentId>, info: PipelineInfo)

This is called after each scene swap occurs. The PipelineInfo contains the updated epochs and pipelines removed in the new scene compared to the old scene.

source

fn post_resource_update(&self, document_ids: &Vec<DocumentId>)

This is called after a resource update operation on the scene builder thread, in the case where resource updates were applied without a scene build.

source

fn post_empty_scene_build(&self)

This is called after a scene build completes without any changes being made. We guarantee that each pre_scene_build call will be matched with exactly one of post_scene_swap, post_resource_update or post_empty_scene_build.

source

fn poke(&self)

This is a generic callback which provides an opportunity to run code on the scene builder thread. This is called as part of the main message loop of the scene builder thread, but outside of any specific message handler.

source

fn deregister(&self)

This is called exactly once, when the scene builder thread is about to terminate.

Implementors§