mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-22 02:01:55 +07:00
Remove Vec from Shadow::render()
This commit is contained in:
+3
-3
@@ -3994,12 +3994,12 @@ impl<W: LayoutElement> Layout<W> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render_floating_for_output<R: NiriRenderer>(
|
pub fn render_floating_for_output<'a, R: NiriRenderer + 'a>(
|
||||||
&self,
|
&'a self,
|
||||||
renderer: &mut R,
|
renderer: &mut R,
|
||||||
output: &Output,
|
output: &Output,
|
||||||
target: RenderTarget,
|
target: RenderTarget,
|
||||||
) -> impl Iterator<Item = TileRenderElement<R>> {
|
) -> impl Iterator<Item = TileRenderElement<R>> + 'a {
|
||||||
if self.update_render_elements_time != self.clock.now() {
|
if self.update_render_elements_time != self.clock.now() {
|
||||||
error!("clock moved between updating render elements and rendering");
|
error!("clock moved between updating render elements and rendering");
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-13
@@ -157,26 +157,19 @@ impl Shadow {
|
|||||||
&self,
|
&self,
|
||||||
renderer: &mut impl NiriRenderer,
|
renderer: &mut impl NiriRenderer,
|
||||||
location: Point<f64, Logical>,
|
location: Point<f64, Logical>,
|
||||||
) -> impl Iterator<Item = ShadowRenderElement> {
|
) -> impl Iterator<Item = ShadowRenderElement> + '_ {
|
||||||
let mut rv = Vec::new();
|
|
||||||
|
|
||||||
if !self.config.on {
|
if !self.config.on {
|
||||||
return rv.into_iter();
|
return None.into_iter().flatten();
|
||||||
}
|
}
|
||||||
|
|
||||||
let has_shadow_shader = ShadowRenderElement::has_shader(renderer);
|
let has_shadow_shader = ShadowRenderElement::has_shader(renderer);
|
||||||
if !has_shadow_shader {
|
if !has_shadow_shader {
|
||||||
return rv.into_iter();
|
return None.into_iter().flatten();
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut push = |shader: &ShadowRenderElement, location: Point<f64, Logical>| {
|
let rv = zip(&self.shaders, &self.shader_rects)
|
||||||
rv.push(shader.clone().with_location(location));
|
.map(move |(shader, rect)| shader.clone().with_location(location + rect.loc));
|
||||||
};
|
|
||||||
|
|
||||||
for (shader, rect) in zip(&self.shaders, &self.shader_rects) {
|
Some(rv).into_iter().flatten()
|
||||||
push(shader, location + rect.loc);
|
|
||||||
}
|
|
||||||
|
|
||||||
rv.into_iter()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -710,14 +710,14 @@ impl<W: LayoutElement> Tile<W> {
|
|||||||
.unwrap_or_else(|| !self.window.has_ssd())
|
.unwrap_or_else(|| !self.window.has_ssd())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_inner<R: NiriRenderer>(
|
fn render_inner<'a, R: NiriRenderer + 'a>(
|
||||||
&self,
|
&'a self,
|
||||||
renderer: &mut R,
|
renderer: &mut R,
|
||||||
location: Point<f64, Logical>,
|
location: Point<f64, Logical>,
|
||||||
scale: Scale<f64>,
|
scale: Scale<f64>,
|
||||||
focus_ring: bool,
|
focus_ring: bool,
|
||||||
target: RenderTarget,
|
target: RenderTarget,
|
||||||
) -> impl Iterator<Item = TileRenderElement<R>> {
|
) -> impl Iterator<Item = TileRenderElement<R>> + 'a {
|
||||||
let _span = tracy_client::span!("Tile::render_inner");
|
let _span = tracy_client::span!("Tile::render_inner");
|
||||||
|
|
||||||
let alpha = if self.is_fullscreen {
|
let alpha = if self.is_fullscreen {
|
||||||
@@ -926,14 +926,14 @@ impl<W: LayoutElement> Tile<W> {
|
|||||||
rv.chain(self.shadow.render(renderer, location).map(Into::into))
|
rv.chain(self.shadow.render(renderer, location).map(Into::into))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render<R: NiriRenderer>(
|
pub fn render<'a, R: NiriRenderer + 'a>(
|
||||||
&self,
|
&'a self,
|
||||||
renderer: &mut R,
|
renderer: &mut R,
|
||||||
location: Point<f64, Logical>,
|
location: Point<f64, Logical>,
|
||||||
scale: Scale<f64>,
|
scale: Scale<f64>,
|
||||||
focus_ring: bool,
|
focus_ring: bool,
|
||||||
target: RenderTarget,
|
target: RenderTarget,
|
||||||
) -> impl Iterator<Item = TileRenderElement<R>> {
|
) -> impl Iterator<Item = TileRenderElement<R>> + 'a {
|
||||||
let _span = tracy_client::span!("Tile::render");
|
let _span = tracy_client::span!("Tile::render");
|
||||||
|
|
||||||
let mut open_anim_elem = None;
|
let mut open_anim_elem = None;
|
||||||
|
|||||||
Reference in New Issue
Block a user