pub struct TextRenderer { /* private fields */ }Expand description
A text renderer that uses cached glyphs to render text into an existing render pass.
Implementations§
Source§impl TextRenderer
impl TextRenderer
Sourcepub fn new(
atlas: &mut TextAtlas,
device: &Device,
multisample: MultisampleState,
depth_stencil: Option<DepthStencilState>,
) -> Self
pub fn new( atlas: &mut TextAtlas, device: &Device, multisample: MultisampleState, depth_stencil: Option<DepthStencilState>, ) -> Self
Creates a new TextRenderer.
Sourcepub fn prepare_with_depth<'a>(
&mut self,
device: &Device,
queue: &Queue,
encoder: &mut CommandEncoder,
font_system: &mut FontSystem,
atlas: &mut TextAtlas,
viewport: &Viewport,
text_areas: impl IntoIterator<Item = TextArea<'a>>,
cache: &mut SwashCache,
metadata_to_depth: impl FnMut(usize) -> f32,
) -> Result<(), PrepareError>
pub fn prepare_with_depth<'a>( &mut self, device: &Device, queue: &Queue, encoder: &mut CommandEncoder, font_system: &mut FontSystem, atlas: &mut TextAtlas, viewport: &Viewport, text_areas: impl IntoIterator<Item = TextArea<'a>>, cache: &mut SwashCache, metadata_to_depth: impl FnMut(usize) -> f32, ) -> Result<(), PrepareError>
Prepares all of the provided text areas for rendering.
pub fn prepare<'a>( &mut self, device: &Device, queue: &Queue, encoder: &mut CommandEncoder, font_system: &mut FontSystem, atlas: &mut TextAtlas, viewport: &Viewport, text_areas: impl IntoIterator<Item = TextArea<'a>>, cache: &mut SwashCache, ) -> Result<(), PrepareError>
Sourcepub fn render(
&self,
atlas: &TextAtlas,
viewport: &Viewport,
pass: &mut RenderPass<'_>,
) -> Result<(), RenderError>
pub fn render( &self, atlas: &TextAtlas, viewport: &Viewport, pass: &mut RenderPass<'_>, ) -> Result<(), RenderError>
Renders all layouts that were previously provided to prepare.
Auto Trait Implementations§
impl Freeze for TextRenderer
impl !RefUnwindSafe for TextRenderer
impl Send for TextRenderer
impl Sync for TextRenderer
impl Unpin for TextRenderer
impl UnsafeUnpin for TextRenderer
impl !UnwindSafe for TextRenderer
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
Mutably borrows from an owned value. Read more