summaryrefslogtreecommitdiffstats
path: root/wgpu/src/backend.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-27 20:26:13 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-27 20:26:13 +0200
commit5b6e205e998cbb20b3c8aaff8b515d78315d6703 (patch)
tree2a9e9e045fa0f9dbffdad3757fac4cf8ac16a895 /wgpu/src/backend.rs
parent5ae726e02c4d6c9889ef7335d9bc80ef1992e34f (diff)
downloadiced-5b6e205e998cbb20b3c8aaff8b515d78315d6703.tar.gz
iced-5b6e205e998cbb20b3c8aaff8b515d78315d6703.tar.bz2
iced-5b6e205e998cbb20b3c8aaff8b515d78315d6703.zip
Simplify `offscreen` API as `color` module in `iced_wgpu`
Diffstat (limited to '')
-rw-r--r--wgpu/src/backend.rs44
1 files changed, 1 insertions, 43 deletions
diff --git a/wgpu/src/backend.rs b/wgpu/src/backend.rs
index 7c962308..b524c615 100644
--- a/wgpu/src/backend.rs
+++ b/wgpu/src/backend.rs
@@ -1,3 +1,4 @@
+use crate::core;
use crate::core::{Color, Font, Point, Size};
use crate::graphics::backend;
use crate::graphics::color;
@@ -5,7 +6,6 @@ use crate::graphics::{Primitive, Transformation, Viewport};
use crate::quad;
use crate::text;
use crate::triangle;
-use crate::{core, offscreen};
use crate::{Layer, Settings};
#[cfg(feature = "tracing")]
@@ -123,48 +123,6 @@ impl Backend {
self.image_pipeline.end_frame();
}
- /// Performs an offscreen render pass. If the `format` selected by WGPU is not
- /// `wgpu::TextureFormat::Rgba8UnormSrgb`, it will be run through a blit.
- ///
- /// Returns `None` if the `frame` is `Rgba8UnormSrgb`, else returns the newly
- /// converted texture view in `Rgba8UnormSrgb`.
- pub fn offscreen<T: AsRef<str>>(
- &mut self,
- device: &wgpu::Device,
- queue: &wgpu::Queue,
- encoder: &mut wgpu::CommandEncoder,
- clear_color: Option<Color>,
- frame: &wgpu::TextureView,
- format: wgpu::TextureFormat,
- primitives: &[Primitive],
- viewport: &Viewport,
- overlay_text: &[T],
- size: wgpu::Extent3d,
- ) -> Option<wgpu::Texture> {
- #[cfg(feature = "tracing")]
- let _ = info_span!("iced_wgpu::offscreen", "DRAW").entered();
-
- self.present(
- device,
- queue,
- encoder,
- clear_color,
- frame,
- primitives,
- viewport,
- overlay_text,
- );
-
- if format != wgpu::TextureFormat::Rgba8UnormSrgb {
- log::info!("Texture format is {format:?}; performing conversion to rgba8..");
- let pipeline = offscreen::Pipeline::new(device);
-
- return Some(pipeline.convert(device, frame, size, encoder));
- }
-
- None
- }
-
fn prepare_text(
&mut self,
device: &wgpu::Device,