pub struct DeviceTile { /* private fields */ }Expand description
A tile on the render device: the resource, the device it was created on, what its values are, and where the tile starts in it.
Implementations§
Source§impl DeviceTile
impl DeviceTile
Sourcepub fn texture(device: &Device, texture: Texture) -> DeviceTile
pub fn texture(device: &Device, texture: Texture) -> DeviceTile
A tile read from texture, created on device; scene-referred
values, from the texture’s top left.
Sourcepub fn buffer(
device: &Device,
buffer: Buffer,
layout: BufferLayout,
) -> DeviceTile
pub fn buffer( device: &Device, buffer: Buffer, layout: BufferLayout, ) -> DeviceTile
A tile read from buffer, created on device, laid out as
layout says; scene-referred values, from pixel (0, 0).
Sourcepub fn encoding(self, encoding: Encoding) -> DeviceTile
pub fn encoding(self, encoding: Encoding) -> DeviceTile
What the values are (Encoding::Scene by default).
Sourcepub fn origin(self, origin: [u32; 2]) -> DeviceTile
pub fn origin(self, origin: [u32; 2]) -> DeviceTile
The tile starts at pixel origin of the resource (a tile cut
from a larger image): its request.size pixels from there.
Sourcepub fn fallback(
self,
pixels: impl FnOnce() -> Option<Pixels> + Send + 'static,
) -> DeviceTile
pub fn fallback( self, pixels: impl FnOnce() -> Option<Pixels> + Send + 'static, ) -> DeviceTile
CPU pixels, made only when the viewport refuses the tile (another
device, no GPU path, a resource that does not fit): they then
take the CPU tiles’ path. Called at most once, on the thread that
calls TileSink::deliver_device,
never on the interface thread (unless the source delivers from
it): a tile refused when the interface takes it in is dropped,
its fallback not called, and the tile asked for again through
the source’s request. None gives up (the request fails).
Sourcepub fn keep(self, value: impl Any + Send + Sync) -> DeviceTile
pub fn keep(self, value: impl Any + Send + Sync) -> DeviceTile
Keeps value alive as long as the viewport holds the tile: until
the tile is replaced, evicted, invalidated or refused, or the
viewport’s state is dropped (on the GPU path, at the next paint
after the release, once the tile’s binding is gone). For what
owns the resource’s memory on the producer’s side (its image and
the charge it carries in a GPU memory ledger), so that memory is
accounted for while it is shown. Each call adds one value.
pub fn resource(&self) -> &Resource
pub fn has_fallback(&self) -> bool
Sourcepub fn check(
&self,
render: Option<&RenderDevice>,
size: [u32; 2],
) -> Result<(), DeviceTileError>
pub fn check( &self, render: Option<&RenderDevice>, size: [u32; 2], ) -> Result<(), DeviceTileError>
Whether the viewport can draw it for a tile of size pixels on
render (None: no GPU path installed).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeviceTile
impl !RefUnwindSafe for DeviceTile
impl Send for DeviceTile
impl !Sync for DeviceTile
impl Unpin for DeviceTile
impl UnsafeUnpin for DeviceTile
impl !UnwindSafe for DeviceTile
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> 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§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.