pub enum Renderer {
Vger(VgerRenderer),
TinySkia(TinySkiaRenderer<Arc<dyn Window>>),
Uninitialized {
scale: f64,
size: Size,
},
}Variants§
Vger(VgerRenderer)
TinySkia(TinySkiaRenderer<Arc<dyn Window>>)
Uninitialized
Uninitialized renderer, used to allow the renderer to be created lazily All operations on this renderer are no-ops
Implementations§
Source§impl Renderer
impl Renderer
pub fn new( window: Arc<dyn Window>, gpu_resources: GpuResources, surface: Surface<'static>, scale: f64, size: Size, font_embolden: f32, ) -> Self
pub fn resize(&mut self, scale: f64, size: Size)
pub fn set_scale(&mut self, scale: f64)
pub fn scale(&self) -> f64
pub fn size(&self) -> Size
Trait Implementations§
Source§impl Renderer for Renderer
impl Renderer for Renderer
fn begin(&mut self, capture: bool)
fn clear_clip(&mut self)
Source§fn stroke<'b, 's>(
&mut self,
shape: &impl Shape,
brush: impl Into<BrushRef<'b>>,
stroke: &'s Stroke,
)
fn stroke<'b, 's>( &mut self, shape: &impl Shape, brush: impl Into<BrushRef<'b>>, stroke: &'s Stroke, )
Stroke a
Shape.Source§fn fill<'b>(
&mut self,
path: &impl Shape,
brush: impl Into<BrushRef<'b>>,
blur_radius: f64,
)
fn fill<'b>( &mut self, path: &impl Shape, brush: impl Into<BrushRef<'b>>, blur_radius: f64, )
Fill a
Shape, using the non-zero fill rule.Source§fn push_layer(
&mut self,
blend: impl Into<BlendMode>,
alpha: f32,
transform: Affine,
clip: &impl Shape,
)
fn push_layer( &mut self, blend: impl Into<BlendMode>, alpha: f32, transform: Affine, clip: &impl Shape, )
Push a layer (This is not supported with Vger)
fn draw_text_with_layout<'b>( &mut self, layout: impl Iterator<Item = LayoutRun<'b>>, pos: impl Into<Point>, )
fn draw_img(&mut self, img: Img<'_>, rect: Rect)
fn draw_svg<'b>( &mut self, svg: Svg<'b>, rect: Rect, brush: Option<impl Into<BrushRef<'b>>>, )
fn set_transform(&mut self, transform: Affine)
fn set_z_index(&mut self, z_index: i32)
fn finish(&mut self) -> Option<ImageBrush>
Source§fn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>)
fn draw_text(&mut self, layout: &TextLayout, pos: impl Into<Point>)
Draw a
TextLayout. Read morefn debug_info(&self) -> String
Auto Trait Implementations§
impl !Freeze for Renderer
impl !RefUnwindSafe for Renderer
impl Send for Renderer
impl !Sync for Renderer
impl Unpin for Renderer
impl !UnwindSafe for Renderer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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