pub(crate) struct VelloCPUDrawTarget {
ctx: RenderContext,
pixmap: Pixmap,
clips: Vec<Path>,
state: State,
}
Fields§
§ctx: RenderContext
Because this is stateful context
caller cannot assume anything about transform, paint, stroke,
so it should provide it’s own used by each command
but it can assume paint_transform to be identity
and fill rule to be peniko::Fill::NonZero
This is because paint_transform is rarely set, so it’s cheaper to always reset it after use.
pixmap: Pixmap
§clips: Vec<Path>
§state: State
Implementations§
Source§impl VelloCPUDrawTarget
impl VelloCPUDrawTarget
fn with_composition( &mut self, composition_operation: CompositionOrBlending, f: impl FnOnce(&mut Self), )
fn ignore_clips(&mut self, f: impl FnOnce(&mut Self))
fn ensure_drawing(&mut self)
fn pixmap(&mut self) -> &[u8] ⓘ
fn size(&self) -> Size2D<u32>
fn is_viewport_cleared( &mut self, rect: &Rect<f32>, transform: Transform2D<f64>, ) -> bool
Trait Implementations§
Source§impl GenericDrawTarget for VelloCPUDrawTarget
impl GenericDrawTarget for VelloCPUDrawTarget
type SourceSurface = Arc<Pixmap>
fn new(size: Size2D<u32>) -> Self
fn clear_rect(&mut self, rect: &Rect<f32>, transform: Transform2D<f64>)
fn copy_surface( &mut self, surface: Self::SourceSurface, source: Rect<i32>, destination: Point2D<i32>, )
fn create_similar_draw_target(&self, size: &Size2D<i32>) -> Self
fn draw_surface( &mut self, surface: Self::SourceSurface, dest: Rect<f64>, source: Rect<f64>, filter: Filter, composition_options: CompositionOptions, transform: Transform2D<f64>, )
fn draw_surface_with_shadow( &self, _surface: Self::SourceSurface, _dest: &Point2D<f32>, _shadow_options: ShadowOptions, _composition_options: CompositionOptions, )
fn fill( &mut self, path: &Path, fill_rule: FillRule, style: FillOrStrokeStyle, composition_options: CompositionOptions, transform: Transform2D<f64>, )
fn fill_text( &mut self, text_runs: Vec<TextRun>, style: FillOrStrokeStyle, composition_options: CompositionOptions, transform: Transform2D<f64>, )
fn fill_rect( &mut self, rect: &Rect<f32>, style: FillOrStrokeStyle, composition_options: CompositionOptions, transform: Transform2D<f64>, )
fn get_size(&self) -> Size2D<i32>
fn pop_clip(&mut self)
fn push_clip( &mut self, path: &Path, fill_rule: FillRule, transform: Transform2D<f64>, )
fn push_clip_rect(&mut self, rect: &Rect<i32>)
fn stroke( &mut self, path: &Path, style: FillOrStrokeStyle, line_options: LineOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
fn stroke_rect( &mut self, rect: &Rect<f32>, style: FillOrStrokeStyle, line_options: LineOptions, composition_options: CompositionOptions, transform: Transform2D<f64>, )
fn image_descriptor_and_serializable_data( &mut self, ) -> (ImageDescriptor, SerializableImageData)
fn snapshot(&mut self) -> Snapshot
fn surface(&mut self) -> Self::SourceSurface
fn create_source_surface_from_data( &self, data: Snapshot, ) -> Option<Self::SourceSurface>
Auto Trait Implementations§
impl Freeze for VelloCPUDrawTarget
impl !RefUnwindSafe for VelloCPUDrawTarget
impl Send for VelloCPUDrawTarget
impl !Sync for VelloCPUDrawTarget
impl Unpin for VelloCPUDrawTarget
impl !UnwindSafe for VelloCPUDrawTarget
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert