Struct RetainedRaster
pub struct RetainedRaster { /* private fields */ }Expand description
What a host keeps between frames to rasterize them into one retained target: the damage scratch, the backdrop blur and, on a software adapter, the CPU canvas. The app’s own render worker draws with it, and so does the workspace’s render service for each surface it draws for an app, so both produce the same pixels from the same frame.
Implementations§
§impl RetainedRaster
impl RetainedRaster
pub fn new(on_cpu: bool) -> RetainedRaster
pub fn new(on_cpu: bool) -> RetainedRaster
Scratch for one target; on_cpu rasterizes on the CPU and uploads the
pixels (a software adapter, see crate::gpu::rasterizes_on_cpu).
pub fn invalidate(&mut self)
pub fn invalidate(&mut self)
The target was replaced (a resize): nothing retained is current.
pub fn rasterize(
&mut self,
_: (&Device, &Queue),
renderer: Option<&mut Renderer>,
target: RetainedTarget<'_>,
frame: FrameContent<'_>,
) -> (Result<u64, String>, Option<BackdropStats>)
pub fn rasterize( &mut self, _: (&Device, &Queue), renderer: Option<&mut Renderer>, target: RetainedTarget<'_>, frame: FrameContent<'_>, ) -> (Result<u64, String>, Option<BackdropStats>)
Bring target up to date with frame: its backdrops blurred and
substituted, its scroll copies made, its damage (or all of it)
repainted. Returns the pixels rasterized, and the backdrop pass’s
statistics when the frame had backdrops.
renderer is None only while the host’s pipelines are still
compiling: the frame is then rasterized on a raster made
on_cpu, and one that would draw a backdrop is
refused.
pub fn rasterize_damage_only(
&mut self,
gpu: (&Device, &Queue),
renderer: &mut Renderer,
target: RetainedTarget<'_>,
frame: FrameContent<'_>,
) -> (Result<u64, String>, Option<BackdropStats>)
pub fn rasterize_damage_only( &mut self, gpu: (&Device, &Queue), renderer: &mut Renderer, target: RetainedTarget<'_>, frame: FrameContent<'_>, ) -> (Result<u64, String>, Option<BackdropStats>)
Self::rasterize for a frame whose scene holds only what its
damage needs (crate::draw_cull): it is never repainted beyond its
damage. Err with DAMAGE_ONLY_REFUSED when it would have to be
(a whole frame, a backdrop, a copy that cannot be made, a damage too
large to repaint alone); the target then still holds the last frame.
Auto Trait Implementations§
impl Freeze for RetainedRaster
impl !RefUnwindSafe for RetainedRaster
impl Send for RetainedRaster
impl !Sync for RetainedRaster
impl Unpin for RetainedRaster
impl UnsafeUnpin for RetainedRaster
impl !UnwindSafe for RetainedRaster
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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