diff options
-rw-r--r-- | .github/workflows/document.yml | 8 | ||||
-rw-r--r-- | futures/src/backend/native.rs | 4 | ||||
-rw-r--r-- | futures/src/backend/native/smol.rs | 2 | ||||
-rw-r--r-- | futures/src/backend/native/thread_pool.rs | 1 | ||||
-rw-r--r-- | futures/src/lib.rs | 2 | ||||
-rw-r--r-- | graphics/src/lib.rs | 2 | ||||
-rw-r--r-- | runtime/src/lib.rs | 2 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/window/icon.rs | 3 | ||||
-rw-r--r-- | tiny_skia/src/backend.rs | 1 | ||||
-rw-r--r-- | wgpu/src/image.rs | 2 | ||||
-rw-r--r-- | wgpu/src/image/atlas.rs | 35 | ||||
-rw-r--r-- | wgpu/src/image/raster.rs | 4 | ||||
-rw-r--r-- | wgpu/src/image/vector.rs | 5 | ||||
-rw-r--r-- | wgpu/src/lib.rs | 2 | ||||
-rw-r--r-- | widget/src/helpers.rs | 3 | ||||
-rw-r--r-- | widget/src/lib.rs | 1 | ||||
-rw-r--r-- | winit/src/lib.rs | 2 |
18 files changed, 39 insertions, 42 deletions
diff --git a/.github/workflows/document.yml b/.github/workflows/document.yml index e69f4d63..09a7a4d5 100644 --- a/.github/workflows/document.yml +++ b/.github/workflows/document.yml @@ -20,13 +20,13 @@ jobs: -p iced_core \ -p iced_style \ -p iced_futures \ - -p iced_native \ - -p iced_lazy \ + -p iced_runtime \ -p iced_graphics \ -p iced_wgpu \ - -p iced_glow \ + -p iced_tiny_skia \ + -p iced_renderer \ + -p iced_widget \ -p iced_winit \ - -p iced_glutin \ -p iced - name: Write CNAME file run: echo 'docs.iced.rs' > ./target/doc/CNAME diff --git a/futures/src/backend/native.rs b/futures/src/backend/native.rs index 4199ad16..85af2c88 100644 --- a/futures/src/backend/native.rs +++ b/futures/src/backend/native.rs @@ -1,16 +1,12 @@ //! Backends that are only available in native platforms: Windows, macOS, or Linux. -#[cfg_attr(docsrs, doc(cfg(feature = "tokio",)))] #[cfg(feature = "tokio")] pub mod tokio; -#[cfg_attr(docsrs, doc(cfg(feature = "async-std",)))] #[cfg(feature = "async-std")] pub mod async_std; -#[cfg_attr(docsrs, doc(cfg(feature = "smol",)))] #[cfg(feature = "smol")] pub mod smol; -#[cfg_attr(docsrs, doc(cfg(feature = "thread-pool",)))] #[cfg(feature = "thread-pool")] pub mod thread_pool; diff --git a/futures/src/backend/native/smol.rs b/futures/src/backend/native/smol.rs index 30bc8291..00d13d35 100644 --- a/futures/src/backend/native/smol.rs +++ b/futures/src/backend/native/smol.rs @@ -1,9 +1,7 @@ //! A `smol` backend. - use futures::Future; /// A `smol` executor. -#[cfg_attr(docsrs, doc(cfg(feature = "smol")))] #[derive(Debug)] pub struct Executor; diff --git a/futures/src/backend/native/thread_pool.rs b/futures/src/backend/native/thread_pool.rs index da5d4b9b..c96f2682 100644 --- a/futures/src/backend/native/thread_pool.rs +++ b/futures/src/backend/native/thread_pool.rs @@ -2,7 +2,6 @@ use futures::Future; /// A thread pool executor for futures. -#[cfg_attr(docsrs, doc(cfg(feature = "thread-pool")))] pub type Executor = futures::executor::ThreadPool; impl crate::Executor for Executor { diff --git a/futures/src/lib.rs b/futures/src/lib.rs index 397fc2d2..34d81e1e 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -16,7 +16,7 @@ )] #![forbid(unsafe_code, rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use futures; pub use iced_core as core; diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs index b44fd603..bfaac19f 100644 --- a/graphics/src/lib.rs +++ b/graphics/src/lib.rs @@ -20,7 +20,7 @@ )] #![forbid(rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] mod antialiasing; mod error; mod transformation; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index d3b84c7d..50abf7b2 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -42,7 +42,7 @@ clippy::useless_conversion )] #![forbid(unsafe_code, rust_2018_idioms)] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod clipboard; pub mod command; pub mod font; @@ -163,7 +163,7 @@ )] #![forbid(rust_2018_idioms, unsafe_code)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] use iced_widget::graphics; use iced_widget::renderer; use iced_widget::style; diff --git a/src/window/icon.rs b/src/window/icon.rs index b67b2ea3..0fe010ca 100644 --- a/src/window/icon.rs +++ b/src/window/icon.rs @@ -12,7 +12,6 @@ use std::path::Path; /// /// This will return an error in case the file is missing at run-time. You may prefer [`Self::from_file_data`] instead. #[cfg(feature = "image")] -#[cfg_attr(docsrs, doc(cfg(feature = "image")))] pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> { let icon = image_rs::io::Reader::open(icon_path)?.decode()?.to_rgba8(); @@ -24,7 +23,6 @@ pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> { /// This content can be included in your application at compile-time, e.g. using the `include_bytes!` macro. /// You can pass an explicit file format. Otherwise, the file format will be guessed at runtime. #[cfg(feature = "image")] -#[cfg_attr(docsrs, doc(cfg(feature = "image")))] pub fn from_file_data( data: &[u8], explicit_format: Option<image_rs::ImageFormat>, @@ -60,7 +58,6 @@ pub enum Error { /// The `image` crate reported an error. #[cfg(feature = "image")] - #[cfg_attr(docsrs, doc(cfg(feature = "image")))] #[error("Unable to create icon from a file: {0}")] ImageError(#[from] image_rs::error::ImageError), } diff --git a/tiny_skia/src/backend.rs b/tiny_skia/src/backend.rs index 491e80c9..9d0fc527 100644 --- a/tiny_skia/src/backend.rs +++ b/tiny_skia/src/backend.rs @@ -92,6 +92,7 @@ impl Backend { background_color, )), anti_alias: false, + blend_mode: tiny_skia::BlendMode::Source, ..Default::default() }, tiny_skia::FillRule::default(), diff --git a/wgpu/src/image.rs b/wgpu/src/image.rs index 3407aa92..553ba330 100644 --- a/wgpu/src/image.rs +++ b/wgpu/src/image.rs @@ -369,7 +369,6 @@ impl Pipeline { layer::Image::Raster { handle, bounds } => { if let Some(atlas_entry) = raster_cache.upload( device, - queue, encoder, handle, &mut self.texture_atlas, @@ -395,7 +394,6 @@ impl Pipeline { if let Some(atlas_entry) = vector_cache.upload( device, - queue, encoder, handle, *color, diff --git a/wgpu/src/image/atlas.rs b/wgpu/src/image/atlas.rs index 366fe623..9b6dcc46 100644 --- a/wgpu/src/image/atlas.rs +++ b/wgpu/src/image/atlas.rs @@ -65,7 +65,6 @@ impl Atlas { pub fn upload( &mut self, device: &wgpu::Device, - queue: &wgpu::Queue, encoder: &mut wgpu::CommandEncoder, width: u32, height: u32, @@ -112,7 +111,8 @@ impl Atlas { padding, 0, allocation, - queue, + device, + encoder, ); } Entry::Fragmented { fragments, .. } => { @@ -127,7 +127,8 @@ impl Atlas { padding, offset, &fragment.allocation, - queue, + device, + encoder, ); } } @@ -280,8 +281,11 @@ impl Atlas { padding: u32, offset: usize, allocation: &Allocation, - queue: &wgpu::Queue, + device: &wgpu::Device, + encoder: &mut wgpu::CommandEncoder, ) { + use wgpu::util::DeviceExt; + let (x, y) = allocation.position(); let Size { width, height } = allocation.size(); let layer = allocation.layer(); @@ -292,7 +296,22 @@ impl Atlas { depth_or_array_layers: 1, }; - queue.write_texture( + let buffer = + device.create_buffer_init(&wgpu::util::BufferInitDescriptor { + label: Some("image upload buffer"), + contents: data, + usage: wgpu::BufferUsages::COPY_SRC, + }); + + encoder.copy_buffer_to_texture( + wgpu::ImageCopyBuffer { + buffer: &buffer, + layout: wgpu::ImageDataLayout { + offset: offset as u64, + bytes_per_row: Some(4 * image_width + padding), + rows_per_image: Some(image_height), + }, + }, wgpu::ImageCopyTexture { texture: &self.texture, mip_level: 0, @@ -303,12 +322,6 @@ impl Atlas { }, aspect: wgpu::TextureAspect::default(), }, - data, - wgpu::ImageDataLayout { - offset: offset as u64, - bytes_per_row: Some(4 * image_width + padding), - rows_per_image: Some(image_height), - }, extent, ); } diff --git a/wgpu/src/image/raster.rs b/wgpu/src/image/raster.rs index 9b38dce4..a6cba76a 100644 --- a/wgpu/src/image/raster.rs +++ b/wgpu/src/image/raster.rs @@ -63,7 +63,6 @@ impl Cache { pub fn upload( &mut self, device: &wgpu::Device, - queue: &wgpu::Queue, encoder: &mut wgpu::CommandEncoder, handle: &image::Handle, atlas: &mut Atlas, @@ -73,8 +72,7 @@ impl Cache { if let Memory::Host(image) = memory { let (width, height) = image.dimensions(); - let entry = - atlas.upload(device, queue, encoder, width, height, image)?; + let entry = atlas.upload(device, encoder, width, height, image)?; *memory = Memory::Device(entry); } diff --git a/wgpu/src/image/vector.rs b/wgpu/src/image/vector.rs index 58bdf64a..6b9be651 100644 --- a/wgpu/src/image/vector.rs +++ b/wgpu/src/image/vector.rs @@ -74,7 +74,6 @@ impl Cache { pub fn upload( &mut self, device: &wgpu::Device, - queue: &wgpu::Queue, encoder: &mut wgpu::CommandEncoder, handle: &svg::Handle, color: Option<Color>, @@ -138,8 +137,8 @@ impl Cache { }); } - let allocation = atlas - .upload(device, queue, encoder, width, height, &rgba)?; + let allocation = + atlas.upload(device, encoder, width, height, &rgba)?; log::debug!("allocating {} {}x{}", id, width, height); diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index 571d2718..0a5726b5 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -36,7 +36,7 @@ )] #![forbid(rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod layer; pub mod settings; pub mod window; diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 336ac4ee..3f5136f8 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -310,7 +310,6 @@ where /// /// [`Image`]: widget::Image #[cfg(feature = "image")] -#[cfg_attr(docsrs, doc(cfg(feature = "image")))] pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> { crate::Image::new(handle.into()) } @@ -320,7 +319,6 @@ pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> { /// [`Svg`]: widget::Svg /// [`Handle`]: widget::svg::Handle #[cfg(feature = "svg")] -#[cfg_attr(docsrs, doc(cfg(feature = "svg")))] pub fn svg<Renderer>( handle: impl Into<core::svg::Handle>, ) -> crate::Svg<Renderer> @@ -333,7 +331,6 @@ where /// Creates a new [`Canvas`]. #[cfg(feature = "canvas")] -#[cfg_attr(docsrs, doc(cfg(feature = "canvas")))] pub fn canvas<P, Message, Renderer>( program: P, ) -> crate::Canvas<P, Message, Renderer> diff --git a/widget/src/lib.rs b/widget/src/lib.rs index ab1ab95b..9da13f9b 100644 --- a/widget/src/lib.rs +++ b/widget/src/lib.rs @@ -14,6 +14,7 @@ )] #![forbid(unsafe_code, rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use iced_renderer as renderer; pub use iced_renderer::graphics; pub use iced_runtime as runtime; diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 9f6bcebb..62d66d5e 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -29,7 +29,7 @@ )] #![forbid(rust_2018_idioms, unsafe_code)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use iced_graphics as graphics; pub use iced_runtime as runtime; pub use iced_runtime::core; |