Struct wr_glyph_rasterizer::GlyphRasterizer
source · pub struct GlyphRasterizer {Show 14 fields
workers: Arc<ThreadPool>,
font_contexts: Arc<FontContexts>,
dedicated_thread: Option<GlyphRasterThread>,
fonts: FastHashSet<FontKey>,
pending_glyph_count: usize,
pending_glyph_jobs: usize,
glyph_request_count: usize,
pending_glyph_requests: FastHashMap<FontInstance, SmallVec<[GlyphKey; 16]>>,
glyph_rx: Receiver<GlyphRasterJob>,
glyph_tx: Sender<GlyphRasterJob>,
fonts_to_remove: Vec<FontKey>,
font_instances_to_remove: Vec<FontInstance>,
enable_multithreading: bool,
can_use_r8_format: bool,
}
Fields§
§workers: Arc<ThreadPool>
§font_contexts: Arc<FontContexts>
§dedicated_thread: Option<GlyphRasterThread>
§fonts: FastHashSet<FontKey>
The current set of loaded fonts.
pending_glyph_count: usize
The current number of individual glyphs waiting in pending batches.
pending_glyph_jobs: usize
The current number of glyph request jobs that have been kicked to worker threads.
glyph_request_count: usize
The number of glyphs requested this frame.
pending_glyph_requests: FastHashMap<FontInstance, SmallVec<[GlyphKey; 16]>>
A map of current glyph request batches.
glyph_rx: Receiver<GlyphRasterJob>
§glyph_tx: Sender<GlyphRasterJob>
§fonts_to_remove: Vec<FontKey>
§font_instances_to_remove: Vec<FontInstance>
§enable_multithreading: bool
§can_use_r8_format: bool
Implementations§
source§impl GlyphRasterizer
impl GlyphRasterizer
pub fn request_glyphs<F>( &mut self, font: FontInstance, glyph_keys: &[GlyphKey], handle: F, )
pub fn enable_multithreading(&mut self, enable: bool)
sourcefn flush_glyph_requests(
&mut self,
font: FontInstance,
glyphs: SmallVec<[GlyphKey; 16]>,
use_workers: bool,
)
fn flush_glyph_requests( &mut self, font: FontInstance, glyphs: SmallVec<[GlyphKey; 16]>, use_workers: bool, )
Internal method to flush a list of glyph requests to a set of worker threads, or process on this thread if there isn’t much work to do (in which case the overhead of processing these on a thread is unlikely to be a performance win).
pub fn resolve_glyphs<F, G>(&mut self, handle: F, profile: &mut G)
source§impl GlyphRasterizer
impl GlyphRasterizer
pub fn new( workers: Arc<ThreadPool>, dedicated_thread: Option<GlyphRasterThread>, can_use_r8_format: bool, ) -> Self
pub fn add_font(&mut self, font_key: FontKey, template: FontTemplate)
pub fn delete_font(&mut self, font_key: FontKey)
pub fn delete_fonts(&mut self, font_keys: &[FontKey])
pub fn delete_font_instance(&mut self, instance: &FontInstance)
pub fn prepare_font(&self, font: &mut FontInstance)
pub fn has_font(&self, font_key: FontKey) -> bool
pub fn get_glyph_dimensions( &mut self, font: &FontInstance, glyph_index: GlyphIndex, ) -> Option<GlyphDimensions>
pub fn get_glyph_index(&mut self, font_key: FontKey, ch: char) -> Option<u32>
fn remove_dead_fonts(&mut self)
Auto Trait Implementations§
impl Freeze for GlyphRasterizer
impl !RefUnwindSafe for GlyphRasterizer
impl Send for GlyphRasterizer
impl Sync for GlyphRasterizer
impl Unpin for GlyphRasterizer
impl !UnwindSafe for GlyphRasterizer
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more