Skip to main content

SnapshotDelegate

Struct SnapshotDelegate 

Source
pub struct SnapshotDelegate { /* private fields */ }
Expand description

Draws pictures into images on the device of a host’s image store, with a renderer made at the first picture.

Implementations§

Source§

impl SnapshotDelegate

Source

pub fn new(images: ImageContext) -> SnapshotDelegate

A delegate drawing on the device images belongs to.

Source

pub fn make_raster_snapshot_sync( &self, picture: &Picture, width: u32, height: u32, ) -> Image

picture drawn into a new image width by height pixels large over transparent black, what lies past those bounds clipped: valo’s display_list_to_image, Impeller’s DisplayListToTexture. The drawing is submitted now, and anything drawn with the image waits for it on the GPU.

§Panics

Where width or height is zero, as Dart throws “Invalid image dimensions.”.

Source

pub fn read_pixels( &self, image: &Image, wait: impl FnOnce(&Device), ) -> ImageFuture<PixelBuffer>

image’s pixels, read back from the device it lives on, wait waiting for the GPU’s answer as the host can: see [read_image_pixels].

Trait Implementations§

Source§

impl Debug for SnapshotDelegate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Freeze for SnapshotDelegate

§

impl !RefUnwindSafe for SnapshotDelegate

§

impl !Sync for SnapshotDelegate

§

impl !UnwindSafe for SnapshotDelegate

§

impl Forget for SnapshotDelegate

§

impl Move for SnapshotDelegate

§

impl Send for SnapshotDelegate
where Arc<CoreDevice>: Send, Arc<CoreQueue>: Send, Arc<MipGenerator>: Send, RefCell<Option<Context>>: Send,

§

impl Unpin for SnapshotDelegate
where Arc<CoreDevice>: Unpin, Arc<CoreQueue>: Unpin, Arc<MipGenerator>: Unpin, Arc<CoreBindGroupLayout>: Unpin, *const u8 is !null: Unpin, Arc<CoreBuffer>: Unpin, Arc<Mutex<MapContext>>: Unpin, InternalBitFlags: Unpin, Arc<CoreBindGroup>: Unpin, Arc<Atomic<bool>>: Unpin, Arc<CoreShaderModule>: Unpin, Arc<CorePipelineLayout>: Unpin, Arc<CoreRenderPipeline>: Unpin, Arc<CoreSampler>: Unpin, *const ArcInner<ImageInner> is !null: Unpin, Arc<ImageInner>: Unpin, Arc<CoreTextureView>: Unpin, Arc<CoreTexture>: Unpin, &'static str: Unpin, InternalBitFlags: Unpin, &'static [TextureFormat]: Unpin, Box<dyn GlyphRaster>: Unpin, Box<[u8]>: Unpin, Arc<Path>: Unpin, *const ArcInner<Path> is !null: Unpin, Arc<Vec<Contour>>: Unpin, Arc<CoreQuerySet>: Unpin, InternalBitFlags: Unpin, Arc<Mutex<SlotState>>: Unpin,

§

impl UnsafeUnpin for SnapshotDelegate
where *const ArcInner<CoreDevice> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreDevice>>: UnsafeUnpin, *const ArcInner<CoreQueue> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreQueue>>: UnsafeUnpin, *const ArcInner<MipGenerator> is !null: UnsafeUnpin, PhantomData<ArcInner<MipGenerator>>: UnsafeUnpin, *const ArcInner<CoreBindGroupLayout> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreBindGroupLayout>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Block<UniformBindGroups>>: UnsafeUnpin, PhantomData<Block<()>>: UnsafeUnpin, *const ArcInner<CoreShaderModule> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreShaderModule>>: UnsafeUnpin, *const ArcInner<CorePipelineLayout> is !null: UnsafeUnpin, PhantomData<ArcInner<CorePipelineLayout>>: UnsafeUnpin, PhantomData<(u64, RuntimeProgram)>: UnsafeUnpin, PhantomData<(RuntimeKey, Vec<(String, f64)>)>: UnsafeUnpin, PhantomData<(PipelineKey, RenderPipeline)>: UnsafeUnpin, PhantomData<(Sampling, Sampler)>: UnsafeUnpin, PhantomData<((u64, Sampling), (Weak<ImageInner>, BindGroup))>: UnsafeUnpin, PhantomData<((u64, ColorFilterKey), FilteredImage)>: UnsafeUnpin, PhantomData<(u64, Entry)>: UnsafeUnpin, PhantomData<PendingRamp>: UnsafeUnpin, *const ArcInner<CoreSampler> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreSampler>>: UnsafeUnpin, PhantomData<Pooled<LayerTarget>>: UnsafeUnpin, PhantomData<Pooled<CopyTexture>>: UnsafeUnpin, PhantomData<Pooled<FilterTarget>>: UnsafeUnpin, PhantomData<Pooled<PyramidTarget>>: UnsafeUnpin, PhantomData<Pooled<Attachments>>: UnsafeUnpin, *const dyn GlyphRaster is !null: UnsafeUnpin, PhantomData<dyn GlyphRaster>: UnsafeUnpin, PhantomData<Page>: UnsafeUnpin, PhantomData<(GlyphKey, (Option<Resident>, u64))>: UnsafeUnpin, PhantomData<((u64, SynthesisKey, u32, u32), PathEntry)>: UnsafeUnpin, PhantomData<((u64, SynthesisKey, u32, CoverageKey), Vec<(f32, u8)>)>: UnsafeUnpin, PhantomData<((usize, i32), Entry)>: UnsafeUnpin, PhantomData<(u64, Entry)>: UnsafeUnpin, *const ArcInner<CoreQuerySet> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreQuerySet>>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, *const ArcInner<CoreBuffer> is !null: UnsafeUnpin, PhantomData<ArcInner<CoreBuffer>>: UnsafeUnpin, *const ArcInner<Mutex<MapContext>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<MapContext>>>: UnsafeUnpin, InternalBitFlags: UnsafeUnpin, PhantomData<Slot>: 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<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> WasmNotSend for T
where T: Send,