summaryrefslogtreecommitdiffstats
path: root/wgpu/src/image
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-06-03 03:04:38 +0200
committerLibravatar GitHub <noreply@github.com>2023-06-03 03:04:38 +0200
commitc15f1b5f6575792cc89bb5fba2e613428397e46a (patch)
tree77526943d7aac8004e3ac7dca07154dcbbe25a0f /wgpu/src/image
parentb353767d2d9703aae35f10ebf8a9ee1490c3ae37 (diff)
parentb5fc0f4a3aa45d33d81d5799396f0b0770c4dff3 (diff)
downloadiced-c15f1b5f6575792cc89bb5fba2e613428397e46a.tar.gz
iced-c15f1b5f6575792cc89bb5fba2e613428397e46a.tar.bz2
iced-c15f1b5f6575792cc89bb5fba2e613428397e46a.zip
Merge pull request #1888 from iced-rs/web-colors
Introduce `web-colors` feature flag to enable "sRGB linear" blending
Diffstat (limited to 'wgpu/src/image')
-rw-r--r--wgpu/src/image/atlas.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs
index 9b6dcc46..e3de1290 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,
@@ -346,7 +351,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,