Skip to content

Commit 438f97a

Browse files
committed
Use RGBA texture for image and svg pipelines
1 parent 8ce8d37 commit 438f97a

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
@@ -22,7 +22,7 @@ impl Handle {
2222
}
2323

2424
/// Creates an image [`Handle`] containing the image pixels directly. This
25-
/// function expects the input data to be provided as a `Vec<u8>` of BGRA
25+
/// function expects the input data to be provided as a `Vec<u8>` of RGBA
2626
/// pixels.
2727
///
2828
/// This is useful if you have already decoded your image.
@@ -31,7 +31,7 @@ impl Handle {
3131
height: u32,
3232
pixels: impl Into<Cow<'static, [u8]>>,
3333
) -> Handle {
34-
Self::from_data(Data::Pixels {
34+
Self::from_data(Data::Rgba {
3535
width,
3636
height,
3737
pixels: pixels.into(),
@@ -93,8 +93,8 @@ pub enum Data {
9393
/// In-memory data
9494
Bytes(Cow<'static, [u8]>),
9595

96-
/// Decoded image pixels in BGRA format.
97-
Pixels {
96+
/// Decoded image pixels in RGBA format.
97+
Rgba {
9898
/// The width of the image.
9999
width: u32,
100100
/// The height of the image.
@@ -109,7 +109,7 @@ impl std::fmt::Debug for Data {
109109
match self {
110110
Data::Path(path) => write!(f, "Path({:?})", path),
111111
Data::Bytes(_) => write!(f, "Bytes(...)"),
112-
Data::Pixels { width, height, .. } => {
112+
Data::Rgba { width, height, .. } => {
113113
write!(f, "Pixels({} * {})", width, height)
114114
}
115115
}

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)