diff options
Diffstat (limited to '')
-rw-r--r-- | wgpu/src/renderer.rs | 8 | ||||
-rw-r--r-- | wgpu/src/renderer/target.rs | 10 |
2 files changed, 12 insertions, 6 deletions
diff --git a/wgpu/src/renderer.rs b/wgpu/src/renderer.rs index 4199eee5..f27a4b8a 100644 --- a/wgpu/src/renderer.rs +++ b/wgpu/src/renderer.rs @@ -14,6 +14,10 @@ mod widget; pub use target::Target; +/// A [`wgpu`] renderer. +/// +/// [`wgpu`]: https://github.com/gfx-rs/wgpu-rs +#[derive(Debug)] pub struct Renderer { device: Device, queue: Queue, @@ -22,7 +26,7 @@ pub struct Renderer { text_pipeline: text::Pipeline, } -pub struct Layer<'a> { +struct Layer<'a> { bounds: Rectangle<u32>, offset: Vector<u32>, quads: Vec<Quad>, @@ -304,7 +308,7 @@ impl Renderer { &mut self, dpi: f32, transformation: Transformation, - layer: &Layer, + layer: &Layer<'_>, encoder: &mut wgpu::CommandEncoder, target: &wgpu::TextureView, ) { diff --git a/wgpu/src/renderer/target.rs b/wgpu/src/renderer/target.rs index eeeb629a..569f3c62 100644 --- a/wgpu/src/renderer/target.rs +++ b/wgpu/src/renderer/target.rs @@ -2,6 +2,8 @@ use crate::{Renderer, Transformation}; use raw_window_handle::HasRawWindowHandle; +/// A rendering target. +#[derive(Debug)] pub struct Target { surface: wgpu::Surface, width: u16, @@ -12,19 +14,19 @@ pub struct Target { } impl Target { - pub fn dimensions(&self) -> (u16, u16) { + pub(crate) fn dimensions(&self) -> (u16, u16) { (self.width, self.height) } - pub fn dpi(&self) -> f32 { + pub(crate) fn dpi(&self) -> f32 { self.dpi } - pub fn transformation(&self) -> Transformation { + pub(crate) fn transformation(&self) -> Transformation { self.transformation } - pub fn next_frame(&mut self) -> wgpu::SwapChainOutput { + pub(crate) fn next_frame(&mut self) -> wgpu::SwapChainOutput<'_> { self.swap_chain.get_next_texture() } } |