From 438f97a6d00ad0312e7c84b4c1529968bdfba849 Mon Sep 17 00:00:00 2001
From: Héctor Ramón Jiménez <hector0193@gmail.com>
Date: Sat, 5 Nov 2022 03:18:13 +0100
Subject: Use RGBA texture for `image` and `svg` pipelines

---
 glow/src/image/storage.rs    |  2 +-
 graphics/src/image/raster.rs |  2 +-
 native/src/image.rs          | 10 +++++-----
 wgpu/src/image/atlas.rs      |  4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/glow/src/image/storage.rs b/glow/src/image/storage.rs
index e2171fb5..9bc20641 100644
--- a/glow/src/image/storage.rs
+++ b/glow/src/image/storage.rs
@@ -27,7 +27,7 @@ impl image::Storage for Storage {
                 width as i32,
                 height as i32,
                 0,
-                glow::BGRA,
+                glow::RGBA,
                 glow::UNSIGNED_BYTE,
                 Some(data),
             );
diff --git a/graphics/src/image/raster.rs b/graphics/src/image/raster.rs
index 8ed9615d..bad017a9 100644
--- a/graphics/src/image/raster.rs
+++ b/graphics/src/image/raster.rs
@@ -80,7 +80,7 @@ impl<T: Storage> Cache<T> {
                     Memory::Invalid
                 }
             }
-            image::Data::Pixels {
+            image::Data::Rgba {
                 width,
                 height,
                 pixels,
diff --git a/native/src/image.rs b/native/src/image.rs
index b313d96d..06fd7ae6 100644
--- a/native/src/image.rs
+++ b/native/src/image.rs
@@ -22,7 +22,7 @@ impl Handle {
     }
 
     /// Creates an image [`Handle`] containing the image pixels directly. This
-    /// function expects the input data to be provided as a `Vec<u8>` of BGRA
+    /// function expects the input data to be provided as a `Vec<u8>` of RGBA
     /// pixels.
     ///
     /// This is useful if you have already decoded your image.
@@ -31,7 +31,7 @@ impl Handle {
         height: u32,
         pixels: impl Into<Cow<'static, [u8]>>,
     ) -> Handle {
-        Self::from_data(Data::Pixels {
+        Self::from_data(Data::Rgba {
             width,
             height,
             pixels: pixels.into(),
@@ -93,8 +93,8 @@ pub enum Data {
     /// In-memory data
     Bytes(Cow<'static, [u8]>),
 
-    /// Decoded image pixels in BGRA format.
-    Pixels {
+    /// Decoded image pixels in RGBA format.
+    Rgba {
         /// The width of the image.
         width: u32,
         /// The height of the image.
@@ -109,7 +109,7 @@ impl std::fmt::Debug for Data {
         match self {
             Data::Path(path) => write!(f, "Path({:?})", path),
             Data::Bytes(_) => write!(f, "Bytes(...)"),
-            Data::Pixels { width, height, .. } => {
+            Data::Rgba { width, height, .. } => {
                 write!(f, "Pixels({} * {})", width, height)
             }
         }
diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs
index bfb3a9f1..eafe2f96 100644
--- a/wgpu/src/image/atlas.rs
+++ b/wgpu/src/image/atlas.rs
@@ -38,7 +38,7 @@ impl Atlas {
             mip_level_count: 1,
             sample_count: 1,
             dimension: wgpu::TextureDimension::D2,
-            format: wgpu::TextureFormat::Bgra8UnormSrgb,
+            format: wgpu::TextureFormat::Rgba8UnormSrgb,
             usage: wgpu::TextureUsages::COPY_DST
                 | wgpu::TextureUsages::COPY_SRC
                 | wgpu::TextureUsages::TEXTURE_BINDING,
@@ -246,7 +246,7 @@ impl Atlas {
             mip_level_count: 1,
             sample_count: 1,
             dimension: wgpu::TextureDimension::D2,
-            format: wgpu::TextureFormat::Bgra8UnormSrgb,
+            format: wgpu::TextureFormat::Rgba8UnormSrgb,
             usage: wgpu::TextureUsages::COPY_DST
                 | wgpu::TextureUsages::COPY_SRC
                 | wgpu::TextureUsages::TEXTURE_BINDING,
-- 
cgit