Skip to main content

Renderer

Struct Renderer 

Source
pub struct Renderer { /* private fields */ }
Expand description

The fonts and text layout state a renderer keeps between paints.

Implementations§

Source§

impl Renderer

Source

pub fn drawing( &mut self, scene: &Scene, theme: Theme, after: Option<&Drawing>, ) -> Result<Drawing, Undrawable>

The scene laid out once and made into its display list in theme — every color its value there — or why it can’t be drawn: images and shadows that don’t fit the GPU’s atlas together. What the PNG, the canvas and devpage check all start from.

Each image is painted under a blob of its own, made in the order the drawing first paints it — except that a drawing made after the one a canvas last showed, painting the same images in the same order, paints that drawing’s: the GPU then keeps the atlas it has, which holds exactly them, placed as a fresh one would.

Source§

impl Renderer

Source

pub fn layout(&mut self, scene: &Scene) -> Vec<Frame>

Lays the scene out: every node’s box, in tree order — as a drawing lays it out, runs and all.

Source§

impl Renderer

Source

pub fn new() -> Renderer

A renderer with only the embedded Inter faces registered; no system fonts.

Trait Implementations§

Source§

impl Default for Renderer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for Renderer

§

impl !RefUnwindSafe for Renderer

§

impl !UnwindSafe for Renderer

§

impl Forget for Renderer

§

impl Move for Renderer

§

impl Send for Renderer
where Arc<FamilyNameMap>: Send, Arc<GenericFamilyMap>: Send, RawTable<(Arc<[u8]>, FamilyName)>: Send, RawTable<(FamilyId, FamilyName)>: Send, RawTable<(FamilyId, Option<FamilyInfo>)>: Send, SmallVec<[FamilyId; 2]>: Send, RawTable<(Script, PerScript)>: Send, Arc<Shared>: Send, RawVecInner: Send, Arc<FamilyInner>: Send, SmallVec<[QueryFont; 1]>: Send, Arc<dyn AsRef<[u8]> + Sync + Send>: Send, RawTable<(SourceId, Entry<Blob<u8>>)>: Send, Arc<Mutex<Shared>>: Send, NodeRef<Owned, FontId, SetValZST, LeafOrInternal>: Send, BoxRaw<(FontId, SetValZST)>: Send, OnceLock<Option<Box<LookupInfo>>>: Send, Atomic<u16>: Send, Atomic<usize>: Send, BoxRaw<hb_cache_core_t<16, 8, 256, Atomic<u16>>>: Send, Atomic<u32>: Send, BoxRaw<[FontVariation]>: Send, SmallVec<[F2Dot14; 11]>: Send, SmallVec<[u8; 8]>: Send, BoxRaw<[Feature]>: Send, &'static hb_ot_shaper_t: Send, BoxRaw<dyn Any + Sync + Send>: Send, SmallVec<[Feature; 4]>: Send, InternalBitFlags: Send, RawTable<(ImageId, ImageData)>: Send,

§

impl Sync for Renderer
where Arc<FamilyNameMap>: Sync, Arc<GenericFamilyMap>: Sync, RawTable<(Arc<[u8]>, FamilyName)>: Sync, RawTable<(FamilyId, FamilyName)>: Sync, RawTable<(FamilyId, Option<FamilyInfo>)>: Sync, SmallVecData<[FamilyId; 2]>: Sync, FamilyId: Sync, RawTable<(Script, PerScript)>: Sync, Arc<Shared>: Sync, RawVecInner: Sync, Arc<FamilyInner>: Sync, SmallVecData<[QueryFont; 1]>: Sync, QueryFont: Sync, Arc<dyn AsRef<[u8]> + Sync + Send>: Sync, RawTable<(SourceId, Entry<Blob<u8>>)>: Sync, Arc<Mutex<Shared>>: Sync, NodeRef<Owned, FontId, SetValZST, LeafOrInternal>: Sync, BoxRaw<(FontId, SetValZST)>: Sync, OnceLock<Option<Box<LookupInfo>>>: Sync, Atomic<u16>: Sync, Atomic<usize>: Sync, BoxRaw<hb_cache_core_t<16, 8, 256, Atomic<u16>>>: Sync, Atomic<u32>: Sync, BoxRaw<[FontVariation]>: Sync, SmallVecData<[F2Dot14; 11]>: Sync, F2Dot14: Sync, SmallVecData<[u8; 8]>: Sync, u8: Sync, BoxRaw<[Feature]>: Sync, BoxRaw<dyn Any + Sync + Send>: Sync, SmallVecData<[Feature; 4]>: Sync, Feature: Sync, InternalBitFlags: Sync, RawTable<(ImageId, ImageData)>: Sync,

§

impl Unpin for Renderer
where Arc<FamilyNameMap>: Unpin, Arc<GenericFamilyMap>: Unpin, *const u8 is !null: Unpin, Arc<[u8]>: Unpin, Arc<str>: Unpin, Arc<FamilyInner>: Unpin, *const FamilyId is !null: Unpin, FamilyId: Unpin, Arc<Shared>: Unpin, Arc<dyn AsRef<[u8]> + Sync + Send>: Unpin, *const QueryFont is !null: Unpin, QueryFont: Unpin, Arc<Mutex<Shared>>: Unpin, *const LeafNode<FontId, SetValZST> is !null: Unpin, Box<(FontId, SetValZST)>: Unpin, Align4<u32>: Unpin, Box<LookupInfo>: Unpin, Atomic<u16>: Unpin, Align8<usize>: Unpin, Box<hb_cache_core_t<16, 8, 256, Atomic<u16>>>: Unpin, Atomic<u32>: Unpin, Box<[FontVariation]>: Unpin, *const F2Dot14 is !null: Unpin, F2Dot14: Unpin, u8: Unpin, Box<[Feature]>: Unpin, &'static hb_ot_shaper_t: Unpin, Box<dyn Any + Sync + Send>: Unpin, *const Feature is !null: Unpin, Feature: Unpin, InternalBitFlags: Unpin,

§

impl UnsafeUnpin for Renderer
where *const ArcInner<FamilyNameMap> is !null: UnsafeUnpin, PhantomData<ArcInner<FamilyNameMap>>: UnsafeUnpin, *const ArcInner<GenericFamilyMap> is !null: UnsafeUnpin, PhantomData<ArcInner<GenericFamilyMap>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<(Arc<[u8]>, FamilyName)>: UnsafeUnpin, PhantomData<(FamilyId, FamilyName)>: UnsafeUnpin, PhantomData<(FamilyId, Option<FamilyInfo>)>: UnsafeUnpin, *const FamilyId is !null: UnsafeUnpin, PhantomData<FamilyId>: UnsafeUnpin, PhantomData<(Script, PerScript)>: UnsafeUnpin, *const ArcInner<Shared> is !null: UnsafeUnpin, PhantomData<ArcInner<Shared>>: UnsafeUnpin, PhantomData<CachedFamily>: UnsafeUnpin, PhantomData<(SourceId, Entry<Blob<u8>>)>: UnsafeUnpin, *const ArcInner<Mutex<Shared>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Shared>>>: UnsafeUnpin, PhantomData<Blob<u8>>: UnsafeUnpin, *const LeafNode<FontId, SetValZST> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(FontId, SetValZST)>>: UnsafeUnpin, PhantomData<(usize, usize)>: UnsafeUnpin, PhantomData<FontVariation>: UnsafeUnpin, PhantomData<FontFeature>: UnsafeUnpin, PhantomData<ResolvedStyle<()>>: UnsafeUnpin, PhantomData<StyleRun>: UnsafeUnpin, PhantomData<LayoutInlineBox>: UnsafeUnpin, PhantomData<BidiLevel>: UnsafeUnpin, PhantomData<BidiClass>: UnsafeUnpin, PhantomData<(usize, char, BidiMirroringGlyph)>: UnsafeUnpin, PhantomData<Run>: UnsafeUnpin, PhantomData<usize>: UnsafeUnpin, PhantomData<CharInfo>: UnsafeUnpin, PhantomData<(Range<usize>, LineBreakConfig)>: UnsafeUnpin, PhantomData<Range<usize>>: UnsafeUnpin, PhantomData<RangedProperty<()>>: UnsafeUnpin, PhantomData<RangedStyle<()>>: UnsafeUnpin, PhantomData<StyleTreeNode<()>>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<u16>: UnsafeUnpin, PhantomData<Entry<ShapeDataKey, ShaperData>>: UnsafeUnpin, PhantomData<Entry<ShapeInstanceId, ShaperInstance>>: UnsafeUnpin, PhantomData<Entry<ShapePlanId, hb_ot_shape_plan_t>>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, PhantomData<GlyphInfo>: UnsafeUnpin, PhantomData<GlyphPosition>: UnsafeUnpin, PhantomData<BitPage>: UnsafeUnpin, PhantomData<PageInfo>: UnsafeUnpin, Align8<usize>: UnsafeUnpin, PhantomData<Feature>: UnsafeUnpin, PhantomData<Char>: UnsafeUnpin, PhantomData<(ImageId, ImageData)>: UnsafeUnpin, PhantomData<(Painted, Origin)>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.