Struct SkiaBackend
pub struct SkiaBackend<'a> { /* private fields */ }
Implementations§
§impl<'a> SkiaBackend<'a>
impl<'a> SkiaBackend<'a>
pub fn new( canvas: &'a Canvas, font_collection: &'a mut RCHandle<skia_textlayout_FontCollection>, size: (i32, i32), ) -> SkiaBackend<'a>
Trait Implementations§
§impl DrawingBackend for SkiaBackend<'_>
impl DrawingBackend for SkiaBackend<'_>
§type ErrorType = SkiaBackendError
type ErrorType = SkiaBackendError
The error type reported by the backend
§fn draw_line<S>(
&mut self,
from: (i32, i32),
to: (i32, i32),
style: &S,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
S: BackendStyle,
fn draw_line<S>(
&mut self,
from: (i32, i32),
to: (i32, i32),
style: &S,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
S: BackendStyle,
Draw a line on the drawing backend Read more
§fn draw_rect<S>(
&mut self,
upper_left: (i32, i32),
bottom_right: (i32, i32),
style: &S,
fill: bool,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
S: BackendStyle,
fn draw_rect<S>(
&mut self,
upper_left: (i32, i32),
bottom_right: (i32, i32),
style: &S,
fill: bool,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
S: BackendStyle,
Draw a rectangle on the drawing backend Read more
§fn draw_path<S, I>(
&mut self,
path: I,
style: &S,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
fn draw_path<S, I>( &mut self, path: I, style: &S, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
Draw a path on the drawing backend Read more
§fn draw_circle<S>(
&mut self,
center: (i32, i32),
radius: u32,
style: &S,
fill: bool,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
S: BackendStyle,
fn draw_circle<S>(
&mut self,
center: (i32, i32),
radius: u32,
style: &S,
fill: bool,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
S: BackendStyle,
Draw a circle on the drawing backend Read more
fn fill_polygon<S, I>( &mut self, vert: I, style: &S, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
§fn draw_text<TStyle>(
&mut self,
text: &str,
style: &TStyle,
pos: (i32, i32),
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
TStyle: BackendTextStyle,
fn draw_text<TStyle>(
&mut self,
text: &str,
style: &TStyle,
pos: (i32, i32),
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
TStyle: BackendTextStyle,
Draw a text on the drawing backend Read more
§fn estimate_text_size<TStyle>(
&self,
text: &str,
style: &TStyle,
) -> Result<(u32, u32), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
TStyle: BackendTextStyle,
fn estimate_text_size<TStyle>(
&self,
text: &str,
style: &TStyle,
) -> Result<(u32, u32), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>where
TStyle: BackendTextStyle,
Estimate the size of the horizontal text if rendered on this backend.
This is important because some of the backend may not have font ability.
Thus this allows those backend reports proper value rather than ask the
font rasterizer for that. Read more
§fn draw_pixel(
&mut self,
_point: (i32, i32),
_color: BackendColor,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
fn draw_pixel( &mut self, _point: (i32, i32), _color: BackendColor, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
Draw a pixel on the drawing backend Read more
§fn ensure_prepared(
&mut self,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
fn ensure_prepared( &mut self, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
Ensure the backend is ready to draw
§fn present(
&mut self,
) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
fn present( &mut self, ) -> Result<(), DrawingErrorKind<<SkiaBackend<'_> as DrawingBackend>::ErrorType>>
Finalize the drawing step and present all the changes.
This is used as the real-time rendering support.
The backend may implement in the following way, when
ensure_prepared
is called
it checks if it needs a fresh buffer and present
is called rendering all the
pending changes on the screen.Auto Trait Implementations§
impl<'a> Freeze for SkiaBackend<'a>
impl<'a> !RefUnwindSafe for SkiaBackend<'a>
impl<'a> !Send for SkiaBackend<'a>
impl<'a> !Sync for SkiaBackend<'a>
impl<'a> Unpin for SkiaBackend<'a>
impl<'a> !UnwindSafe for SkiaBackend<'a>
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
§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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§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>
§impl<T> IntoDrawingArea for Twhere
T: DrawingBackend,
impl<T> IntoDrawingArea for Twhere
T: DrawingBackend,
§fn into_drawing_area(self) -> DrawingArea<T, Shift>
fn into_drawing_area(self) -> DrawingArea<T, Shift>
Convert the type into a root drawing area
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.