pub struct GpuRenderer { /* private fields */ }Expand description
The GPU render callback.
Holds a shared reference to the editor state. render() reads it under
lock, computes a frame, releases the lock before touching the GPU to
minimise contention with the event loop.
Implementations§
Source§impl GpuRenderer
impl GpuRenderer
pub fn new(state: SharedState) -> Self
Sourcepub fn set_theme(&mut self, theme: FleetTheme)
pub fn set_theme(&mut self, theme: FleetTheme)
Point the renderer at a theme — the wiring that makes
(deftheme :preset …) real.
ChromePalette::for_theme is total over FleetTheme (no wildcard
arm), so a theme added upstream fails this to compile rather than
silently painting the wrong thing.
Sourcepub fn chrome(&self) -> ChromePalette
pub fn chrome(&self) -> ChromePalette
The palette currently painted with.
Sourcepub fn with_theme(self, theme: FleetTheme) -> Self
pub fn with_theme(self, theme: FleetTheme) -> Self
Builder form of Self::set_theme.
pub fn with_font_size(self, font_size: f32, line_height: f32) -> Self
Trait Implementations§
Source§impl RenderCallback for GpuRenderer
impl RenderCallback for GpuRenderer
Auto Trait Implementations§
impl !RefUnwindSafe for GpuRenderer
impl !UnwindSafe for GpuRenderer
impl Freeze for GpuRenderer
impl Send for GpuRenderer
impl Sync for GpuRenderer
impl Unpin for GpuRenderer
impl UnsafeUnpin for GpuRenderer
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
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.