vello_hybrid: alloc only once for sizing the alpha texture buffer
diff --git a/sparse_strips/vello_hybrid/src/render.rs b/sparse_strips/vello_hybrid/src/render.rs index 488524d..1d0226b 100644 --- a/sparse_strips/vello_hybrid/src/render.rs +++ b/sparse_strips/vello_hybrid/src/render.rs
@@ -333,8 +333,10 @@ render_data.alphas.len() <= (texture_width * texture_height * 16) as usize, "Alpha texture dimensions are too small to fit the alpha data" ); - let mut alpha_data = render_data.alphas.clone(); - alpha_data.resize((texture_width * texture_height * 16) as usize, 0); + let alpha_data_len = (texture_width * texture_height * 16) as usize; + let mut alpha_data = Vec::with_capacity(alpha_data_len); + alpha_data.extend_from_slice(&render_data.alphas); + alpha_data.resize(alpha_data_len, 0); queue.write_texture( wgpu::TexelCopyTextureInfo {