Skip to content

Commit cf71777

Browse files
committed
Use RGBA texture for image and svg pipelines
1 parent dbf238c commit cf71777

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

glow/src/image/storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl image::Storage for Storage {
2727
width as i32,
2828
height as i32,
2929
0,
30-
glow::BGRA,
30+
glow::RGBA,
3131
glow::UNSIGNED_BYTE,
3232
Some(data),
3333
);

graphics/src/image/raster.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl<T: Storage> Cache<T> {
8080
Memory::Invalid
8181
}
8282
}
83-
image::Data::Pixels {
83+
image::Data::Rgba {
8484
width,
8585
height,
8686
pixels,

native/src/image.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ impl Handle {
2121
}
2222

2323
/// Creates an image [`Handle`] containing the image pixels directly. This
24-
/// function expects the input data to be provided as a `Vec<u8>` of BGRA
24+
/// function expects the input data to be provided as a `Vec<u8>` of RGBA
2525
/// pixels.
2626
///
2727
/// This is useful if you have already decoded your image.
2828
pub fn from_pixels(width: u32, height: u32, pixels: Vec<u8>) -> Handle {
29-
Self::from_data(Data::Pixels {
29+
Self::from_data(Data::Rgba {
3030
width,
3131
height,
3232
pixels,
@@ -88,8 +88,8 @@ pub enum Data {
8888
/// In-memory data
8989
Bytes(Vec<u8>),
9090

91-
/// Decoded image pixels in BGRA format.
92-
Pixels {
91+
/// Decoded image pixels in RGBA format.
92+
Rgba {
9393
/// The width of the image.
9494
width: u32,
9595
/// The height of the image.
@@ -104,7 +104,7 @@ impl std::fmt::Debug for Data {
104104
match self {
105105
Data::Path(path) => write!(f, "Path({:?})", path),
106106
Data::Bytes(_) => write!(f, "Bytes(...)"),
107-
Data::Pixels { width, height, .. } => {
107+
Data::Rgba { width, height, .. } => {
108108
write!(f, "Pixels({} * {})", width, height)
109109
}
110110
}

wgpu/src/image/atlas.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl Atlas {
3838
mip_level_count: 1,
3939
sample_count: 1,
4040
dimension: wgpu::TextureDimension::D2,
41-
format: wgpu::TextureFormat::Bgra8UnormSrgb,
41+
format: wgpu::TextureFormat::Rgba8UnormSrgb,
4242
usage: wgpu::TextureUsages::COPY_DST
4343
| wgpu::TextureUsages::COPY_SRC
4444
| wgpu::TextureUsages::TEXTURE_BINDING,
@@ -246,7 +246,7 @@ impl Atlas {
246246
mip_level_count: 1,
247247
sample_count: 1,
248248
dimension: wgpu::TextureDimension::D2,
249-
format: wgpu::TextureFormat::Bgra8UnormSrgb,
249+
format: wgpu::TextureFormat::Rgba8UnormSrgb,
250250
usage: wgpu::TextureUsages::COPY_DST
251251
| wgpu::TextureUsages::COPY_SRC
252252
| wgpu::TextureUsages::TEXTURE_BINDING,

0 commit comments

Comments
 (0)