forge
Explore
Log in

Don't you dare go Hollow

ShaderRenderElement use borrowed Uniforms to minimize copy (#756)

Browse files at this commit

c8044a9b5dbdb3e0648c86a00bfb63acfc06a559UnverifiedgmorerParent: 289ae36
src/render_helpers/shader_element.rsmodified+4 -4
@@ -185,7 +185,7 @@ impl ShaderRenderElement {
185185 // Should only be used for visual improvements, i.e. corner radius anti-aliasing.
186186 scale: f32,
187187 alpha: f32,
188- uniforms: Vec<Uniform<'_>>,
188+ additional_uniforms: Vec<Uniform<'static>>,
189189 textures: HashMap<String, GlesTexture>,
190190 kind: Kind,
191191 ) -> Self {
@@ -197,7 +197,7 @@ impl ShaderRenderElement {
197197 opaque_regions: opaque_regions.unwrap_or_default(),
198198 scale,
199199 alpha,
200- additional_uniforms: uniforms.into_iter().map(|u| u.into_owned()).collect(),
200+ additional_uniforms,
201201 textures,
202202 kind,
203203 }
@@ -227,13 +227,13 @@ impl ShaderRenderElement {
227227 size: Size<f64, Logical>,
228228 opaque_regions: Option<Vec<Rectangle<f64, Logical>>>,
229229 scale: f32,
230- uniforms: Vec<Uniform<'_>>,
230+ uniforms: Vec<Uniform<'static>>,
231231 textures: HashMap<String, GlesTexture>,
232232 ) {
233233 self.area.size = size;
234234 self.opaque_regions = opaque_regions.unwrap_or_default();
235235 self.scale = scale;
236- self.additional_uniforms = uniforms.into_iter().map(|u| u.into_owned()).collect();
236+ self.additional_uniforms = uniforms;
237237 self.textures = textures;
238238
239239 self.commit_counter.increment();