diff options
| author | 2023-05-31 21:42:39 +0200 | |
|---|---|---|
| committer | 2023-05-31 21:42:39 +0200 | |
| commit | f1b259a28fdb92ce62ceb6fcea9547b52ecc77d3 (patch) | |
| tree | 3ab58a99e32fa1555afeeb4d12079036417cf860 /wgpu/src/image | |
| parent | faa7627ea41b1ce372bae7f0d2ae36e9b15a97a3 (diff) | |
| download | iced-f1b259a28fdb92ce62ceb6fcea9547b52ecc77d3.tar.gz iced-f1b259a28fdb92ce62ceb6fcea9547b52ecc77d3.tar.bz2 iced-f1b259a28fdb92ce62ceb6fcea9547b52ecc77d3.zip | |
Avoid gamma correction when `web-colors` is enabled for images
Diffstat (limited to '')
| -rw-r--r-- | wgpu/src/image/atlas.rs | 7 | 
1 files changed, 6 insertions, 1 deletions
| diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs index 9b6dcc46..28bc4943 100644 --- a/wgpu/src/image/atlas.rs +++ b/wgpu/src/image/atlas.rs @@ -13,6 +13,7 @@ use allocator::Allocator;  pub const SIZE: u32 = 2048;  use crate::core::Size; +use crate::graphics::color;  #[derive(Debug)]  pub struct Atlas { @@ -35,7 +36,11 @@ impl Atlas {              mip_level_count: 1,              sample_count: 1,              dimension: wgpu::TextureDimension::D2, -            format: wgpu::TextureFormat::Rgba8UnormSrgb, +            format: if color::GAMMA_CORRECTION { +                wgpu::TextureFormat::Rgba8UnormSrgb +            } else { +                wgpu::TextureFormat::Rgba8Unorm +            },              usage: wgpu::TextureUsages::COPY_DST                  | wgpu::TextureUsages::COPY_SRC                  | wgpu::TextureUsages::TEXTURE_BINDING, | 
