summaryrefslogtreecommitdiffstats
path: root/wgpu/src/image
diff options
context:
space:
mode:
Diffstat (limited to 'wgpu/src/image')
-rw-r--r--wgpu/src/image/raster.rs4
-rw-r--r--wgpu/src/image/vector.rs4
2 files changed, 3 insertions, 5 deletions
diff --git a/wgpu/src/image/raster.rs b/wgpu/src/image/raster.rs
index 4f69df8c..25607dab 100644
--- a/wgpu/src/image/raster.rs
+++ b/wgpu/src/image/raster.rs
@@ -43,14 +43,14 @@ impl Cache {
let memory = match handle.data() {
image::Data::Path(path) => {
if let Ok(image) = ::image::open(path) {
- Memory::Host(image.to_bgra())
+ Memory::Host(image.to_bgra8())
} else {
Memory::NotFound
}
}
image::Data::Bytes(bytes) => {
if let Ok(image) = ::image::load_from_memory(&bytes) {
- Memory::Host(image.to_bgra())
+ Memory::Host(image.to_bgra8())
} else {
Memory::Invalid
}
diff --git a/wgpu/src/image/vector.rs b/wgpu/src/image/vector.rs
index 7648aa7e..95df2e99 100644
--- a/wgpu/src/image/vector.rs
+++ b/wgpu/src/image/vector.rs
@@ -2,8 +2,6 @@ use crate::image::atlas::{self, Atlas};
use iced_native::svg;
use std::collections::{HashMap, HashSet};
-use zerocopy::AsBytes;
-
pub enum Svg {
Loaded(resvg::usvg::Tree),
NotFound,
@@ -119,7 +117,7 @@ impl Cache {
let allocation = texture_atlas.upload(
width,
height,
- canvas.get_data().as_bytes(),
+ bytemuck::cast_slice(canvas.get_data()),
device,
encoder,
)?;