From 8c3b87c5fcac8323ef28b7d870e56a1f4e1cca86 Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl Date: Tue, 28 Jul 2026 12:59:55 +0200 Subject: [PATCH 1/2] . --- sparse_strips/vello_hybrid/src/render/webgl.rs | 16 ++++++++-------- sparse_strips/vello_hybrid/src/render/wgpu.rs | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sparse_strips/vello_hybrid/src/render/webgl.rs b/sparse_strips/vello_hybrid/src/render/webgl.rs index d8536771f..d2abb2b06 100644 --- a/sparse_strips/vello_hybrid/src/render/webgl.rs +++ b/sparse_strips/vello_hybrid/src/render/webgl.rs @@ -651,14 +651,14 @@ impl WebGlRenderer { self.paint_idxs[encoded_paint_idx] = current_idx; match paint { EncodedPaint::Image(img) => { - if let ImageSource::OpaqueId { id: image_id, .. } = img.source { - let image_resource: Option<&ImageResource> = image_cache.get(image_id); - if let Some(image_resource) = image_resource { - let gpu_image = self.encode_image_paint(img, image_resource); - self.encoded_paints[encoded_paint_idx] = gpu_image; - current_idx += GPU_ENCODED_IMAGE_SIZE_TEXELS; - } - } + let ImageSource::OpaqueId { id: image_id, .. } = img.source else { + panic!("pixmap image sources are not supported by Vello Hybrid"); + }; + + let image_resource = image_cache.get(image_id).unwrap(); + let gpu_image = self.encode_image_paint(img, image_resource); + self.encoded_paints[encoded_paint_idx] = gpu_image; + current_idx += GPU_ENCODED_IMAGE_SIZE_TEXELS; } EncodedPaint::Gradient(gradient) => { let (gradient_start, gradient_width) = diff --git a/sparse_strips/vello_hybrid/src/render/wgpu.rs b/sparse_strips/vello_hybrid/src/render/wgpu.rs index 9ca85f233..a71825aa1 100644 --- a/sparse_strips/vello_hybrid/src/render/wgpu.rs +++ b/sparse_strips/vello_hybrid/src/render/wgpu.rs @@ -690,14 +690,14 @@ impl Renderer { self.paint_idxs[encoded_paint_idx] = current_idx; match paint { EncodedPaint::Image(img) => { - if let ImageSource::OpaqueId { id: image_id, .. } = img.source { - let image_resource: Option<&ImageResource> = image_cache.get(image_id); - if let Some(image_resource) = image_resource { - let image_paint = self.encode_image_paint(img, image_resource); - self.encoded_paints[encoded_paint_idx] = image_paint; - current_idx += GPU_ENCODED_IMAGE_SIZE_TEXELS; - } - } + let ImageSource::OpaqueId { id: image_id, .. } = img.source else { + panic!("pixmap image sources are not supported by Vello Hybrid"); + }; + + let image_resource = image_cache.get(image_id).unwrap(); + let image_paint = self.encode_image_paint(img, image_resource); + self.encoded_paints[encoded_paint_idx] = image_paint; + current_idx += GPU_ENCODED_IMAGE_SIZE_TEXELS; } EncodedPaint::ExternalTexture(img) => { if texture_bindings.get(img.texture_id).is_none() { From 2e5e51bffca1a7bf3dfa955a1717e91780164389 Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl Date: Tue, 28 Jul 2026 14:41:21 +0200 Subject: [PATCH 2/2] Reformat --- sparse_strips/vello_hybrid/src/render/webgl.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sparse_strips/vello_hybrid/src/render/webgl.rs b/sparse_strips/vello_hybrid/src/render/webgl.rs index d2abb2b06..5ed32c347 100644 --- a/sparse_strips/vello_hybrid/src/render/webgl.rs +++ b/sparse_strips/vello_hybrid/src/render/webgl.rs @@ -654,7 +654,7 @@ impl WebGlRenderer { let ImageSource::OpaqueId { id: image_id, .. } = img.source else { panic!("pixmap image sources are not supported by Vello Hybrid"); }; - + let image_resource = image_cache.get(image_id).unwrap(); let gpu_image = self.encode_image_paint(img, image_resource); self.encoded_paints[encoded_paint_idx] = gpu_image;