diff options
author | 2022-11-04 23:25:01 -0700 | |
---|---|---|
committer | 2022-11-04 23:25:01 -0700 | |
commit | a250aab958b837ccf3a315617c39c7bd3e423c42 (patch) | |
tree | 7b4124b6a8e43917d95c205e09871a419b8757e9 | |
parent | 370fa14efb8d41bcf81e4a0ead6a9ab7ab750bee (diff) | |
download | iced-a250aab958b837ccf3a315617c39c7bd3e423c42.tar.gz iced-a250aab958b837ccf3a315617c39c7bd3e423c42.tar.bz2 iced-a250aab958b837ccf3a315617c39c7bd3e423c42.zip |
Don't convert svg to BGRA before passing to shader
Now that the shader is using RGBA, this incorrectly swaps the
components.
-rw-r--r-- | graphics/src/image/vector.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/graphics/src/image/vector.rs b/graphics/src/image/vector.rs index dc271c9e..42f4b500 100644 --- a/graphics/src/image/vector.rs +++ b/graphics/src/image/vector.rs @@ -121,15 +121,8 @@ impl<T: Storage> Cache<T> { img.as_mut(), )?; - let mut rgba = img.take(); - rgba.chunks_exact_mut(4).for_each(|rgba| rgba.swap(0, 2)); - - let allocation = storage.upload( - width, - height, - bytemuck::cast_slice(rgba.as_slice()), - state, - )?; + let allocation = + storage.upload(width, height, img.data(), state)?; log::debug!("allocating {} {}x{}", id, width, height); let _ = self.svg_hits.insert(id); |