Skip to main content

SoftwarePresenter

Struct SoftwarePresenter 

Source
pub struct SoftwarePresenter { /* private fields */ }

Implementations§

Source§

impl SoftwarePresenter

Source

pub fn new(window: SoftwareWindow) -> Result<Self, String>

Source

pub fn scale_factor(&self) -> f32

Source

pub fn set_scale_factor(&mut self, sf: f32)

Source

pub fn logical_size(&self) -> Size

Source

pub fn set_logical_size(&mut self, size: Size)

Source

pub fn render(&mut self, frame: &FramePaint) -> RgbaImage

只渲染不上屏(截图/测试用)

Source

pub fn present(&mut self, frame: &FramePaint) -> Result<(), String>

渲染一帧并 present 到窗口

Trait Implementations§

Source§

impl SoftwareBackend for SoftwarePresenter

让 Runner 的软件回退直接使用本 presenter(应用在 create_software_backend 里返回)

Source§

fn present(&mut self, frame: &FramePaint) -> Result<(), String>

渲染并 present 一帧 FramePaint
Source§

fn set_scale_factor(&mut self, scale_factor: f32)

Source§

fn set_logical_size(&mut self, size: Size)

Auto Trait Implementations§

§

impl !RefUnwindSafe for SoftwarePresenter

§

impl !Send for SoftwarePresenter

§

impl !Sync for SoftwarePresenter

§

impl !UnwindSafe for SoftwarePresenter

§

impl Forget for SoftwarePresenter

§

impl Freeze for SoftwarePresenter
where *const ArcInner<X11DisplayImpl<Arc<Window>>> is !null: Freeze, PhantomData<ArcInner<X11DisplayImpl<Arc<Window>>>>: Freeze, *const ArcInner<WaylandDisplayImpl<Arc<Window>>> is !null: Freeze, PhantomData<ArcInner<WaylandDisplayImpl<Arc<Window>>>>: Freeze, *const ArcInner<KmsDisplayImpl<Arc<Window>>> is !null: Freeze, PhantomData<ArcInner<KmsDisplayImpl<Arc<Window>>>>: Freeze, PhantomData<Arc<Arc<Window>>>: Freeze, *const SurfaceDispatch<Arc<Window>, Arc<Window>> is !null: Freeze, PhantomData<SurfaceDispatch<Arc<Window>, Arc<Window>>>: Freeze, PhantomData<Cell<()>>: Freeze, *const u8 is !null: Freeze, PhantomData<(u32, (Rc<ImageData>, Pixmap))>: Freeze, PhantomData<(u32, u64)>: Freeze, PhantomData<(GlyphCacheKey, Pixmap)>: Freeze, PhantomData<(ImageTintKey, Pixmap)>: Freeze, PhantomData<(RasterCacheKey, RasterCacheEntry)>: Freeze, PhantomData<u8>: Freeze, NonZero<u32>: Freeze, PhantomData<((u32, u32), Vec<Pixmap>)>: Freeze, PhantomData<(LayerId, usize)>: Freeze, PhantomData<(LayerId, LayerComposition)>: Freeze, PhantomData<(LayerId, ())>: Freeze, PhantomData<(LayerId, Size)>: Freeze,

§

impl Move for SoftwarePresenter

§

impl Unpin for SoftwarePresenter
where Arc<X11DisplayImpl<Arc<Window>>>: Unpin, Arc<WaylandDisplayImpl<Arc<Window>>>: Unpin, Arc<KmsDisplayImpl<Arc<Window>>>: Unpin, Arc<Arc<Window>>: Unpin, Box<SurfaceDispatch<Arc<Window>, Arc<Window>>>: Unpin, *const u8 is !null: Unpin, Rc<ImageData>: Unpin, NonZero<u32>: Unpin,

§

impl UnsafeUnpin for SoftwarePresenter
where *const ArcInner<X11DisplayImpl<Arc<Window>>> is !null: UnsafeUnpin, PhantomData<ArcInner<X11DisplayImpl<Arc<Window>>>>: UnsafeUnpin, *const ArcInner<WaylandDisplayImpl<Arc<Window>>> is !null: UnsafeUnpin, PhantomData<ArcInner<WaylandDisplayImpl<Arc<Window>>>>: UnsafeUnpin, *const ArcInner<KmsDisplayImpl<Arc<Window>>> is !null: UnsafeUnpin, PhantomData<ArcInner<KmsDisplayImpl<Arc<Window>>>>: UnsafeUnpin, PhantomData<Arc<Arc<Window>>>: UnsafeUnpin, *const SurfaceDispatch<Arc<Window>, Arc<Window>> is !null: UnsafeUnpin, PhantomData<SurfaceDispatch<Arc<Window>, Arc<Window>>>: UnsafeUnpin, PhantomData<Cell<()>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<(u32, (Rc<ImageData>, Pixmap))>: UnsafeUnpin, PhantomData<(u32, u64)>: UnsafeUnpin, PhantomData<(GlyphCacheKey, Pixmap)>: UnsafeUnpin, PhantomData<(ImageTintKey, Pixmap)>: UnsafeUnpin, PhantomData<(RasterCacheKey, RasterCacheEntry)>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, PhantomData<((u32, u32), Vec<Pixmap>)>: UnsafeUnpin, PhantomData<(LayerId, usize)>: UnsafeUnpin, PhantomData<(LayerId, LayerComposition)>: UnsafeUnpin, PhantomData<(LayerId, ())>: UnsafeUnpin, PhantomData<(LayerId, Size)>: 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more