pub struct TileSink { /* private fields */ }Expand description
Where a source delivers; cheap to clone, usable from any thread.
Implementations§
Source§impl TileSink
impl TileSink
Sourcepub fn deliver(&self, tile: Tile)
pub fn deliver(&self, tile: Tile)
Delivers a tile. When the viewport prepares on the worker side, the pixels are converted here, on the calling thread.
Sourcepub fn deliver_device(&self, request: &TileRequest, tile: DeviceTile)
pub fn deliver_device(&self, request: &TileRequest, tile: DeviceTile)
Delivers a tile that lives on the render device (feature wgpu,
see crate::device): bound by the GPU path, nothing copied.
The work writing it must have been submitted to the render
device’s queue before this call. Checked here, on the calling
thread, against the render device installed now
(TileSink::render_device): a tile the viewport cannot draw is
refused, the error kept
(ViewportState::last_error),
and its fallback pixels, when it has some, made here and
delivered as TileSink::deliver does; without, the request
fails. Fallback pixels are asked for again as a device tile when
the render device changes (the GPU path installed late).
The interface checks the tile again when it takes it in: one
refused there (the device changed in between) is dropped and its
request made again through TileSource::request, so the
fallback never runs on the interface thread.
Sourcepub fn render_device(&self) -> Option<RenderDevice>
pub fn render_device(&self) -> Option<RenderDevice>
The render device device tiles must be created on (feature
wgpu): the one installed now in the viewport’s context
(gpu::render_device), read when
called. None without a GPU path, and before the viewport’s first
frame (the sink learns its context there). It reads egui’s
context: not from inside one of its closures (ctx.input(|i| …)),
as for any context call.
Sourcepub fn changed(&self, region: Option<[f64; 4]>)
pub fn changed(&self, region: Option<[f64; 4]>)
The image changed in region ([x0, y0, x1, y1], image pixels),
or everywhere (None, also for a new size). While NOTICES
changes and readouts wait (the viewport is not drawn), it is
folded into one change of the whole image.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TileSink
impl RefUnwindSafe for TileSink
impl Send for TileSink
impl Sync for TileSink
impl Unpin for TileSink
impl UnsafeUnpin for TileSink
impl UnwindSafe for TileSink
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> DowncastSync for T
impl<T> DowncastSync 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§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.