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
impl SnapshotDelegate
Sourcepub fn new(images: ImageContext) -> SnapshotDelegate
pub fn new(images: ImageContext) -> SnapshotDelegate
A delegate drawing on the device images belongs to.
Sourcepub fn make_raster_snapshot_sync(
&self,
picture: &Picture,
width: u32,
height: u32,
) -> Image
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.”.
Sourcepub fn read_pixels(
&self,
image: &Image,
wait: impl FnOnce(&Device),
) -> ImageFuture<PixelBuffer>
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§
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
impl Unpin for SnapshotDelegatewhere
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 SnapshotDelegatewhere
*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> 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
Mutably borrows from an owned value. Read more