pub struct Builder {
pub depth_format: TextureFormat,
pub glyph_cache_size: [u32; 2],
pub glyph_cache_scale_tolerance: f32,
pub glyph_cache_position_tolerance: f32,
}
Expand description
A type aimed at simplifying construction of a draw::Renderer
.
Fields§
§depth_format: TextureFormat
§glyph_cache_size: [u32; 2]
§glyph_cache_scale_tolerance: f32
§glyph_cache_position_tolerance: f32
Implementations§
source§impl Builder
impl Builder
sourcepub const DEFAULT_DEPTH_FORMAT: TextureFormat = Renderer::DEFAULT_DEPTH_FORMAT
pub const DEFAULT_DEPTH_FORMAT: TextureFormat = Renderer::DEFAULT_DEPTH_FORMAT
The default depth format
sourcepub const DEFAULT_GLYPH_CACHE_SIZE: [u32; 2] = Renderer::DEFAULT_GLYPH_CACHE_SIZE
pub const DEFAULT_GLYPH_CACHE_SIZE: [u32; 2] = Renderer::DEFAULT_GLYPH_CACHE_SIZE
The default size for the inner glyph cache.
sourcepub const DEFAULT_GLYPH_CACHE_SCALE_TOLERANCE: f32 = 0.100000001f32
pub const DEFAULT_GLYPH_CACHE_SCALE_TOLERANCE: f32 = 0.100000001f32
The default scale tolerance for the glyph cache.
sourcepub const DEFAULT_GLYPH_CACHE_POSITION_TOLERANCE: f32 = 0.100000001f32
pub const DEFAULT_GLYPH_CACHE_POSITION_TOLERANCE: f32 = 0.100000001f32
The default position tolerance for the glyph cache.
sourcepub fn depth_format(self, format: TextureFormat) -> Self
pub fn depth_format(self, format: TextureFormat) -> Self
Specify the texture format that should be used to represent depth data in the renderer’s
inner depth_texture
.
sourcepub fn glyph_cache_size(self, size: [u32; 2]) -> Self
pub fn glyph_cache_size(self, size: [u32; 2]) -> Self
The dimensions of the texture used to cache glyphs.
Some text-heavy apps may require a text cache larger than the default size in order to run efficiently without text glitching. If the texture is insufficiently large for all text currently appearing within the output attachment, artifacts will appear in the text.
sourcepub fn glyph_cache_scale_tolerance(self, tolerance: f32) -> Self
pub fn glyph_cache_scale_tolerance(self, tolerance: f32) -> Self
Specifies the tolerances (maximum allowed difference) for judging whether an existing glyph in the cache is close enough to the requested glyph in scale to be used in its place.
Due to floating point inaccuracies a min value of 0.001 is enforced.
sourcepub fn glyph_cache_position_tolerance(self, tolerance: f32) -> Self
pub fn glyph_cache_position_tolerance(self, tolerance: f32) -> Self
Specifies the tolerances (maximum allowed difference) for judging whether an existing glyph in the cache is close enough to the requested glyph in subpixel offset to be used in its place.
Due to floating point inaccuracies a min value of 0.001 is enforced.
sourcepub fn build_from_texture_descriptor(
self,
device: &Device,
descriptor: &TextureDescriptor<'_>
) -> Renderer
pub fn build_from_texture_descriptor( self, device: &Device, descriptor: &TextureDescriptor<'_> ) -> Renderer
Build the draw::Renderer ready to target an output attachment of the given descriptor.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
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
source§impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
impl<T, U> ConvertInto<U> for Twhere
U: ConvertFrom<T>,
source§fn convert_into(self) -> U
fn convert_into(self) -> U
source§fn convert_unclamped_into(self) -> U
fn convert_unclamped_into(self) -> U
source§fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains the unclamped color. Read more