Skip to main content

SingleThreadedDispatcher

Struct SingleThreadedDispatcher 

Source
pub(crate) struct SingleThreadedDispatcher {
    bucketer: RefCell<CommandBucketer>,
    viewport: ViewportState,
    recorder: CommandRecorder<RecordedFill>,
    strip_storage: StripStorage,
    level: Level,
}
Expand description

Single-threaded implementation of the rendering dispatcher.

Fields§

§bucketer: RefCell<CommandBucketer>

Reusable coarse bucketer that converts recorded commands into per-row render commands.

§viewport: ViewportState

Viewport state.

§recorder: CommandRecorder<RecordedFill>

Recorder for root and filter-layer command streams, plus layer metadata.

§strip_storage: StripStorage

Storage for generated strips and alpha coverage data.

§level: Level

SIMD level for fearless SIMD dispatch.

Implementations§

Source§

impl SingleThreadedDispatcher

Source

pub(crate) fn new(width: u16, height: u16, level: Level) -> Self

Creates a new single-threaded dispatcher for the given dimensions.

§Arguments
  • width - Width of the rendering surface in pixels.
  • height - Height of the rendering surface in pixels.
  • level - SIMD level to use for rasterization.
Source

fn rasterize_u8( &self, target: PixmapMut<'_>, scene_width: u16, scene_height: u16, settings: RasterizerSettings, encoded_paints: &[EncodedPaint], image_resolver: &dyn ImageResolver, )

Rasterizes the scene using u8 precision (fast).

This dispatches to the appropriate SIMD implementation based on the configured level, using u8 for intermediate calculations to maximize speed.

Source

fn rasterize_with<S: Simd, F: FineKernel<S>>( &self, simd: S, target: PixmapMut<'_>, scene_width: u16, scene_height: u16, settings: RasterizerSettings, encoded_paints: &[EncodedPaint], image_resolver: &dyn ImageResolver, )

Source

fn bucket_and_rasterize<S: Simd, F: FineKernel<S>>( &self, simd: S, cmds: &[Node], viewport: RectU16, filter_ctx: &FilterContext, target: PixmapMut<'_>, params: FineRenderParams, use_src_over: bool, encoded_paints: &[EncodedPaint], image_resolver: &dyn ImageResolver, )

Source

fn rasterize_target<S: Simd, F: FineKernel<S>>( simd: S, bucketer: &CommandBucketer, resources: FineResources<'_>, regions: &mut Regions<'_>, use_src_over: bool, )

Source

fn record_fill( &mut self, strip_start: usize, paint: Paint, blend_mode: BlendMode, mask: Option<Mask>, )

Source

fn rasterize_filter_layers<S: Simd, F: FineKernel<S>>( &self, simd: S, encoded_paints: &[EncodedPaint], image_resolver: &dyn ImageResolver, ) -> FilterContext

Trait Implementations§

Source§

impl Debug for SingleThreadedDispatcher

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Dispatcher for SingleThreadedDispatcher

Source§

fn has_layers(&self) -> bool

Source§

fn fill_path( &mut self, path: &BezPath, fill_rule: Fill, transform: Affine, paint: Paint, blend_mode: BlendMode, aliasing_threshold: Option<u8>, mask: Option<Mask>, )

Source§

fn stroke_path( &mut self, path: &BezPath, stroke: &Stroke, transform: Affine, paint: Paint, blend_mode: BlendMode, aliasing_threshold: Option<u8>, mask: Option<Mask>, )

Source§

fn fill_rect_fast( &mut self, rect: &Rect, paint: Paint, blend_mode: BlendMode, mask: Option<Mask>, )

Fill a pixel-aligned rectangle with the current paint.
Source§

fn push_layer( &mut self, clip_path: Option<&BezPath>, fill_rule: Fill, clip_transform: Affine, blend_mode: BlendMode, opacity: f32, aliasing_threshold: Option<u8>, mask: Option<Mask>, filter_data: Option<FilterData>, )

Source§

fn pop_layer(&mut self)

Source§

fn reset(&mut self, width: u16, height: u16)

Source§

fn flush(&mut self)

Source§

fn rasterize( &self, target: PixmapMut<'_>, scene_width: u16, scene_height: u16, settings: RasterizerSettings, encoded_paints: &[EncodedPaint], image_resolver: &dyn ImageResolver, )

Source§

fn push_clip_path( &mut self, path: &BezPath, fill_rule: Fill, transform: Affine, aliasing_threshold: Option<u8>, )

Source§

fn pop_clip_path(&mut self)

Source§

fn is_multi_threaded(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.