Skip to content

Commit

Permalink
desktop: make space render_output more ergonomic
Browse files Browse the repository at this point in the history
We can use IntoIterator instead of requiring a slice
for render_output and space_render_elements
  • Loading branch information
cmeissl authored and Drakulix committed Oct 11, 2022
1 parent ed6544e commit cb05b11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion anvil/src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ where
output,
renderer,
age,
&[space],
[space],
custom_elements,
damage_tracked_renderer,
CLEAR_COLOR,
Expand Down
4 changes: 2 additions & 2 deletions smallvil/src/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ pub fn winit_dispatch(
let damage = Rectangle::from_loc_and_size((0, 0), size);

backend.bind().ok().and_then(|_| {
smithay::desktop::space::render_output::<_, WaylandSurfaceRenderElement, _, _>(
smithay::desktop::space::render_output::<_, WaylandSurfaceRenderElement, _, _, _>(
output,
backend.renderer(),
0,
&[&state.space],
[&state.space],
&[],
damage_tracked_renderer,
[0.1, 0.1, 0.1, 1.0],
Expand Down
10 changes: 6 additions & 4 deletions src/desktop/space/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,10 @@ pub fn space_render_elements<
'a,
#[cfg(feature = "wayland_frontend")] R: Renderer + ImportAll,
#[cfg(not(feature = "wayland_frontend"))] R: Renderer,
E: SpaceElement + PartialEq + AsRenderElements<R>,
E: SpaceElement + PartialEq + AsRenderElements<R> + 'a,
S: IntoIterator<Item = &'a Space<E>>,
>(
spaces: &[&'a Space<E>],
spaces: S,
output: &Output,
) -> Result<Vec<SpaceRenderElements<R, <E as AsRenderElements<R>>::RenderElement>>, OutputNoMode>
where
Expand Down Expand Up @@ -544,13 +545,14 @@ pub fn render_output<
#[cfg(feature = "wayland_frontend")] R: Renderer + ImportAll,
#[cfg(not(feature = "wayland_frontend"))] R: Renderer,
C: RenderElement<R>,
E: SpaceElement + PartialEq + AsRenderElements<R>,
E: SpaceElement + PartialEq + AsRenderElements<R> + 'a,
L: Into<Option<slog::Logger>>,
S: IntoIterator<Item = &'a Space<E>>,
>(
output: &Output,
renderer: &mut R,
age: usize,
spaces: &[&'a Space<E>],
spaces: S,
custom_elements: &'a [C],
damage_tracked_renderer: &mut DamageTrackedRenderer,
clear_color: [f32; 4],
Expand Down

0 comments on commit cb05b11

Please sign in to comment.