Don't restrict render command listeners to the static lifetime
This commit is contained in:
parent
28c4bc194d
commit
18d2b006ac
|
@ -43,7 +43,7 @@ pub(crate) struct SceneBuilder<'a, 'b> {
|
||||||
scene: &'a mut Scene,
|
scene: &'a mut Scene,
|
||||||
built_options: &'b PreparedBuildOptions,
|
built_options: &'b PreparedBuildOptions,
|
||||||
next_alpha_tile_indices: [AtomicUsize; ALPHA_TILE_LEVEL_COUNT],
|
next_alpha_tile_indices: [AtomicUsize; ALPHA_TILE_LEVEL_COUNT],
|
||||||
pub(crate) listener: Box<dyn RenderCommandListener>,
|
pub(crate) listener: Box<dyn RenderCommandListener + 'a>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -102,8 +102,9 @@ impl<'a, 'b> SceneBuilder<'a, 'b> {
|
||||||
pub(crate) fn new(
|
pub(crate) fn new(
|
||||||
scene: &'a mut Scene,
|
scene: &'a mut Scene,
|
||||||
built_options: &'b PreparedBuildOptions,
|
built_options: &'b PreparedBuildOptions,
|
||||||
listener: Box<dyn RenderCommandListener>,
|
listener: Box<dyn RenderCommandListener + 'a>,
|
||||||
) -> SceneBuilder<'a, 'b> {
|
) -> SceneBuilder<'a, 'b> {
|
||||||
|
let effective_view_box = scene.effective_view_box(built_options);
|
||||||
SceneBuilder {
|
SceneBuilder {
|
||||||
scene,
|
scene,
|
||||||
built_options,
|
built_options,
|
||||||
|
|
|
@ -238,9 +238,9 @@ impl Scene {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn build<E>(&mut self,
|
pub fn build<'a, E>(&mut self,
|
||||||
options: BuildOptions,
|
options: BuildOptions,
|
||||||
listener: Box<dyn RenderCommandListener>,
|
listener: Box<dyn RenderCommandListener + 'a>,
|
||||||
executor: &E)
|
executor: &E)
|
||||||
where E: Executor {
|
where E: Executor {
|
||||||
let prepared_options = options.prepare(self.bounds);
|
let prepared_options = options.prepare(self.bounds);
|
||||||
|
|
Loading…
Reference in New Issue