Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions sparse_strips/vello_hybrid/src/render/webgl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down
16 changes: 8 additions & 8 deletions sparse_strips/vello_hybrid/src/render/wgpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading