pub struct SurfaceRenderTarget { /* private fields */ }Expand description
Vello render target that writes to a surface in memory: a layer.
A scene is rendered into the pixels of the surface in whatever rendering mode draws it; a layer that stays on the GPU is part of the GPU modes (design document, stages 7 and 8).
Implementations§
Source§impl SurfaceRenderTarget
impl SurfaceRenderTarget
Sourcepub fn new(create_info: SurfaceRenderTargetCreateInfo) -> Self
pub fn new(create_info: SurfaceRenderTargetCreateInfo) -> Self
Creates a surface render target. A surface is at least one pixel in each direction.
§Panics
Panics when the surface is larger than a scene can be.
Sourcepub fn properties(&self) -> RenderTargetProperties
pub fn properties(&self) -> RenderTargetProperties
The properties of this render target.
Sourcepub fn has_render_context_affinity(&self) -> bool
pub fn has_render_context_affinity(&self) -> bool
Whether the render target lives on a GPU context and can only be used with it. Never the case for pixels in memory.
Source§impl SurfaceRenderTarget
impl SurfaceRenderTarget
Sourcepub fn has_content(&self) -> bool
pub fn has_content(&self) -> bool
Whether a scene was rendered into the surface.
Sourcepub fn create_drawing_context_with(
&self,
disposables: Vec<Box<dyn FnOnce()>>,
) -> DrawingContextImpl
pub fn create_drawing_context_with( &self, disposables: Vec<Box<dyn FnOnce()>>, ) -> DrawingContextImpl
Creates a drawing context that draws into the surface. disposables
run in order when the context is disposed, after the scene was
rendered into the pixels.
Trait Implementations§
Source§impl IBitmapImpl for SurfaceRenderTarget
impl IBitmapImpl for SurfaceRenderTarget
Source§fn pixel_size(&self) -> PixelSize
fn pixel_size(&self) -> PixelSize
The size of the bitmap, in device pixels.
Source§fn save(
&self,
stream: &mut dyn Write,
options: &BitmapEncoderOptions,
) -> Result<()>
fn save( &self, stream: &mut dyn Write, options: &BitmapEncoderOptions, ) -> Result<()>
Saves the bitmap to a stream, encoded as selected by
options.Source§fn as_readable_bitmap(&self) -> Option<&dyn IReadableBitmapImpl>
fn as_readable_bitmap(&self) -> Option<&dyn IReadableBitmapImpl>
The bitmap viewed as
IReadableBitmapImpl, when its pixels can be
read.Source§impl IDrawingContextLayerImpl for SurfaceRenderTarget
impl IDrawingContextLayerImpl for SurfaceRenderTarget
Source§fn blit(&self, context: &mut dyn IDrawingContextImpl)
fn blit(&self, context: &mut dyn IDrawingContextImpl)
Does optimized blit with source OVER overlay mode.
Source§fn is_corrupted(&self) -> bool
fn is_corrupted(&self) -> bool
Whether the layer’s contents have been lost.
The contents of the layer as a bitmap that can leave the render
thread. A layer itself stays on the thread that created it.
Source§fn create_drawing_context(&self) -> Box<dyn IDrawingContextImpl>
fn create_drawing_context(&self) -> Box<dyn IDrawingContextImpl>
Creates a drawing context that draws into the layer.
Source§fn as_layer_with_render_context_affinity(
&self,
) -> Option<&dyn IDrawingContextLayerWithRenderContextAffinityImpl>
fn as_layer_with_render_context_affinity( &self, ) -> Option<&dyn IDrawingContextLayerWithRenderContextAffinityImpl>
The layer as one that may be bound to the render context it was
created with, if it is one.
Auto Trait Implementations§
impl !RefUnwindSafe for SurfaceRenderTarget
impl !Send for SurfaceRenderTarget
impl !Sync for SurfaceRenderTarget
impl !UnwindSafe for SurfaceRenderTarget
impl Freeze for SurfaceRenderTarget
impl Unpin for SurfaceRenderTarget
impl UnsafeUnpin for SurfaceRenderTarget
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more