diff options
-rw-r--r-- | examples/README.md | 5 | ||||
-rw-r--r-- | examples/solar_system/src/main.rs | 8 | ||||
-rw-r--r-- | examples/tour/README.md | 9 | ||||
-rw-r--r-- | wgpu/src/triangle.rs | 13 | ||||
-rw-r--r-- | wgpu/src/triangle/msaa.rs | 15 |
5 files changed, 15 insertions, 35 deletions
diff --git a/examples/README.md b/examples/README.md index 137d134c..2b4919df 100644 --- a/examples/README.md +++ b/examples/README.md @@ -27,10 +27,6 @@ You can run the native version with `cargo run`: cargo run --package tour ``` -The web version can be run by following [the usage instructions of `iced_web`] or by accessing [iced.rs](https://iced.rs/)! - -[the usage instructions of `iced_web`]: https://github.com/iced-rs/iced_web#usage - ## [Todos](todos) A todos tracker inspired by [TodoMVC]. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them. @@ -46,7 +42,6 @@ You can run the native version with `cargo run`: ``` cargo run --package todos ``` -We have not yet implemented a `LocalStorage` version of the auto-save feature. Therefore, it does not work on web _yet_! [TodoMVC]: http://todomvc.com/ diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs index 12184dd1..e96b53ff 100644 --- a/examples/solar_system/src/main.rs +++ b/examples/solar_system/src/main.rs @@ -48,6 +48,10 @@ impl Application for SolarSystem { String::from("Solar system - Iced") } + fn background_color(&self) -> Color { + Color::BLACK + } + fn update(&mut self, message: Message) -> Command<Message> { match message { Message::Tick(instant) => { @@ -137,16 +141,12 @@ impl<Message> canvas::Program<Message> for State { use std::f32::consts::PI; let background = self.space_cache.draw(bounds.size(), |frame| { - let space = Path::rectangle(Point::new(0.0, 0.0), frame.size()); - let stars = Path::new(|path| { for (p, size) in &self.stars { path.rectangle(*p, Size::new(*size, *size)); } }); - frame.fill(&space, Color::BLACK); - frame.translate(frame.center() - Point::ORIGIN); frame.fill(&stars, Color::WHITE); }); diff --git a/examples/tour/README.md b/examples/tour/README.md index e7cd2d5c..731e7e66 100644 --- a/examples/tour/README.md +++ b/examples/tour/README.md @@ -23,6 +23,11 @@ You can run the native version with `cargo run`: cargo run --package tour ``` -The web version can be run by following [the usage instructions of `iced_web`] or by accessing [iced.rs](https://iced.rs/)! +The web version can be run with [`trunk`]: -[the usage instructions of `iced_web`]: https://github.com/iced-rs/iced_web#usage +``` +cd examples/tour +trunk serve +``` + +[`trunk`]: https://trunkrs.dev/ diff --git a/wgpu/src/triangle.rs b/wgpu/src/triangle.rs index c702243b..bed64e99 100644 --- a/wgpu/src/triangle.rs +++ b/wgpu/src/triangle.rs @@ -162,18 +162,7 @@ impl Pipeline { entry_point: "fs_main", targets: &[wgpu::ColorTargetState { format, - blend: Some(wgpu::BlendState { - color: wgpu::BlendComponent { - src_factor: wgpu::BlendFactor::SrcAlpha, - dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, - operation: wgpu::BlendOperation::Add, - }, - alpha: wgpu::BlendComponent { - src_factor: wgpu::BlendFactor::One, - dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, - operation: wgpu::BlendOperation::Add, - }, - }), + blend: Some(wgpu::BlendState::ALPHA_BLENDING), write_mask: wgpu::ColorWrites::ALL, }], }), diff --git a/wgpu/src/triangle/msaa.rs b/wgpu/src/triangle/msaa.rs index 9fb87544..5d3ee311 100644 --- a/wgpu/src/triangle/msaa.rs +++ b/wgpu/src/triangle/msaa.rs @@ -95,18 +95,9 @@ impl Blit { entry_point: "fs_main", targets: &[wgpu::ColorTargetState { format, - blend: Some(wgpu::BlendState { - color: wgpu::BlendComponent { - src_factor: wgpu::BlendFactor::SrcAlpha, - dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, - operation: wgpu::BlendOperation::Add, - }, - alpha: wgpu::BlendComponent { - src_factor: wgpu::BlendFactor::One, - dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha, - operation: wgpu::BlendOperation::Add, - }, - }), + blend: Some( + wgpu::BlendState::PREMULTIPLIED_ALPHA_BLENDING, + ), write_mask: wgpu::ColorWrites::ALL, }], }), |