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: ViewportStateViewport state.
recorder: CommandRecorder<RecordedFill>Recorder for root and filter-layer command streams, plus layer metadata.
strip_storage: StripStorageStorage for generated strips and alpha coverage data.
level: LevelSIMD level for fearless SIMD dispatch.
Implementations§
Source§impl SingleThreadedDispatcher
impl SingleThreadedDispatcher
Sourcepub(crate) fn new(width: u16, height: u16, level: Level) -> Self
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.
Sourcefn rasterize_u8(
&self,
target: PixmapMut<'_>,
scene_width: u16,
scene_height: u16,
settings: RasterizerSettings,
encoded_paints: &[EncodedPaint],
image_resolver: &dyn ImageResolver,
)
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.
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, )
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, )
fn rasterize_target<S: Simd, F: FineKernel<S>>( simd: S, bucketer: &CommandBucketer, resources: FineResources<'_>, regions: &mut Regions<'_>, use_src_over: bool, )
fn record_fill( &mut self, strip_start: usize, paint: Paint, blend_mode: BlendMode, mask: Option<Mask>, )
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
impl Debug for SingleThreadedDispatcher
Source§impl Dispatcher for SingleThreadedDispatcher
impl Dispatcher for SingleThreadedDispatcher
fn has_layers(&self) -> bool
fn fill_path( &mut self, path: &BezPath, fill_rule: Fill, transform: Affine, paint: Paint, blend_mode: BlendMode, aliasing_threshold: Option<u8>, mask: Option<Mask>, )
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>,
)
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.
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>, )
fn pop_layer(&mut self)
fn reset(&mut self, width: u16, height: u16)
fn flush(&mut self)
fn rasterize( &self, target: PixmapMut<'_>, scene_width: u16, scene_height: u16, settings: RasterizerSettings, encoded_paints: &[EncodedPaint], image_resolver: &dyn ImageResolver, )
fn push_clip_path( &mut self, path: &BezPath, fill_rule: Fill, transform: Affine, aliasing_threshold: Option<u8>, )
fn pop_clip_path(&mut self)
fn is_multi_threaded(&self) -> bool
Auto Trait Implementations§
impl !Freeze for SingleThreadedDispatcher
impl !RefUnwindSafe for SingleThreadedDispatcher
impl Send for SingleThreadedDispatcher
impl !Sync for SingleThreadedDispatcher
impl Unpin for SingleThreadedDispatcher
impl UnsafeUnpin for SingleThreadedDispatcher
impl UnwindSafe for SingleThreadedDispatcher
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> 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