Draft multi-threaded image rendering in iced_wgpu
This commit is contained in:
parent
92888a3639
commit
cb8d2710da
22 changed files with 886 additions and 305 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::graphics::Antialiasing;
|
||||
use crate::graphics::{Antialiasing, Shell};
|
||||
use crate::primitive;
|
||||
use crate::quad;
|
||||
use crate::text;
|
||||
|
|
@ -18,6 +18,7 @@ pub struct Engine {
|
|||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
pub(crate) image_pipeline: crate::image::Pipeline,
|
||||
pub(crate) primitive_storage: Arc<RwLock<primitive::Storage>>,
|
||||
_shell: Shell,
|
||||
}
|
||||
|
||||
impl Engine {
|
||||
|
|
@ -27,6 +28,7 @@ impl Engine {
|
|||
queue: wgpu::Queue,
|
||||
format: wgpu::TextureFormat,
|
||||
antialiasing: Option<Antialiasing>, // TODO: Initialize AA pipelines lazily
|
||||
shell: Shell,
|
||||
) -> Self {
|
||||
Self {
|
||||
format,
|
||||
|
|
@ -52,14 +54,16 @@ impl Engine {
|
|||
|
||||
device,
|
||||
queue,
|
||||
_shell: shell,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "image", feature = "svg"))]
|
||||
pub fn create_image_cache(
|
||||
&self,
|
||||
device: &wgpu::Device,
|
||||
) -> crate::image::Cache {
|
||||
self.image_pipeline.create_cache(device)
|
||||
pub fn create_image_cache(&self) -> crate::image::Cache {
|
||||
self.image_pipeline.create_cache(
|
||||
&self.device,
|
||||
&self.queue,
|
||||
&self._shell,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue