pub struct Renderer {
pub clear_color: Color,
/* private fields */
}Fields§
§clear_color: ColorImplementations§
Source§impl Renderer
impl Renderer
Sourcepub async fn new(
target: impl Into<SurfaceTarget<'static>>,
width: u32,
height: u32,
) -> Result<Renderer, Box<dyn Error>>
pub async fn new( target: impl Into<SurfaceTarget<'static>>, width: u32, height: u32, ) -> Result<Renderer, Box<dyn Error>>
A renderer for one window, on a device of its own.
Sourcepub fn new_in(
gpu: &Gpu,
target: impl Into<SurfaceTarget<'static>>,
width: u32,
height: u32,
) -> Result<Renderer, Box<dyn Error>>
pub fn new_in( gpu: &Gpu, target: impl Into<SurfaceTarget<'static>>, width: u32, height: u32, ) -> Result<Renderer, Box<dyn Error>>
A renderer for another window on an existing device — the one every
window of a session shares. Get it from Renderer::gpu.
Sourcepub fn set_frame_latency(&mut self, frames: u32)
pub fn set_frame_latency(&mut self, frames: u32)
How many frames may be queued ahead of the one on screen (at least
one); see DEFAULT_FRAME_LATENCY. Reconfigures the surface when
it changes.
Sourcepub fn frame_latency(&self) -> u32
pub fn frame_latency(&self) -> u32
The frame latency the surface is configured with.
Sourcepub fn subpixel_text(&self) -> bool
pub fn subpixel_text(&self) -> bool
Whether this device blends per channel, i.e. LCD subpixel glyphs
(QuadKind::GlyphSubpixel) render as intended. Drivers feed this to
Core::set_subpixel_text; without it the core should keep
rasterizing alpha masks.
Sourcepub fn resize(&mut self, width: u32, height: u32)
pub fn resize(&mut self, width: u32, height: u32)
Reconfigures the swapchain for a new window size.
Both bounds are the platform’s, not ours. max(1) because a
minimized window reports zero and a zero-sized surface is a
validation error; min(max_texture_dimension_2d) because Windows
hands out a nonsense size mid-resize — a 2600x1500 move on Windows
11 arrived as 2578x32711 — and configuring a surface larger than
the device can hold panics inside wgpu, taking the app with it. A
clamped frame is one wrong picture; the next real size fixes it.
pub fn render( &mut self, dl: &DisplayList, atlas: &mut GlyphAtlas, ) -> Result<RenderReport, RenderError>
Auto Trait Implementations§
impl !Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl !UnwindSafe for Renderer
impl Send for Renderer
impl Sync for Renderer
impl Unpin for Renderer
impl UnsafeUnpin for Renderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.