pub(crate) fn fill_path(
    path: &Path,
    paint: &Paint,
    fill_type: FillRule,
    clip_mask: Option<&ClipMaskData>,
    pixmap: &mut PixmapMut,
) -> Option<()> {
    // This is sort of similar to SkDraw::drawPath

    // to_rect will fail when bounds' width/height is zero.
    // This is an intended behaviour since the only
    // reason for width/height to be zero is a horizontal/vertical line.
    // And in both cases there is nothing to fill.
    let path_bounds = path.bounds();
    let path_int_bounds = path_bounds.round_out();

    // TODO: ignore paths outside the pixmap

    // TODO: draw tiler
    if path_int_bounds.width() > MAX_DIM || path_int_bounds.height() > MAX_DIM {
        return None;
    }

    if path.is_too_big_for_math() {
        return None;
    }

    let clip_rect = pixmap.size().to_screen_int_rect(0, 0);

    let mut blitter = RasterPipelineBlitter::new(paint, clip_mask, pixmap)?;

    if paint.anti_alias {
        scan::path_aa::fill_path(path, fill_type, &clip_rect, &mut blitter)
    } else {
        scan::path::fill_path(path, fill_type, &clip_rect, &mut blitter)
    }
}
/// Draws a filled path onto the pixmap.
///
/// Returns `None` when there is nothing to fill or in case of a numeric overflow.
Draws a filled path onto the pixmap.
Returns `None` when there is nothing to fill or in case of a numeric overflow.
Draws a filled path onto the pixmap . Returns ` None ` when there is nothing to fill or in case of a numeric overflow .
pub(crate) fn fill_path(
    path: &Path,
    paint: &Paint,
    fill_type: FillRule,
    clip_mask: Option<&ClipMaskData>,
    pixmap: &mut PixmapMut,
) -> Option<()> {
    // This is sort of similar to SkDraw::drawPath
    // to_rect will fail when bounds' width/height is zero.
    // This is an intended behaviour since the only
    // reason for width/height to be zero is a horizontal/vertical line.
    // And in both cases there is nothing to fill.
    let path_bounds = path.bounds();
    let path_int_bounds = path_bounds.round_out();
    // TODO: ignore paths outside the pixmap
    // TODO: draw tiler
    if path_int_bounds.width() > MAX_DIM || path_int_bounds.height() > MAX_DIM {
        return None;
    }
    if path.is_too_big_for_math() {
        return None;
    }
    let clip_rect = pixmap.size().to_screen_int_rect(0, 0);
    let mut blitter = RasterPipelineBlitter::new(paint, clip_mask, pixmap)?;
    if paint.anti_alias {
        scan::path_aa::fill_path(path, fill_type, &clip_rect, &mut blitter)
    } else {
        scan::path::fill_path(path, fill_type, &clip_rect, &mut blitter)
    }
}
pub ( crate ) fn fill_path ( path : & Path , paint : & Paint , fill_type : FillRule , clip_mask : Option < & ClipMaskData > , pixmap : & mut PixmapMut , ) -> Option < ( ) > { // This is sort of similar to SkDraw::drawPath // to_rect will fail when bounds' width/height is zero. // This is an intended behaviour since the only // reason for width/height to be zero is a horizontal/vertical line. // And in both cases there is nothing to fill. let path_bounds = path . bounds ( ) ; let path_int_bounds = path_bounds . round_out ( ) ; // TODO: ignore paths outside the pixmap // TODO: draw tiler if path_int_bounds . width ( ) > MAX_DIM || path_int_bounds . height ( ) > MAX_DIM { return None ; } if path . is_too_big_for_math ( ) { return None ; } let clip_rect = pixmap . size ( ) . to_screen_int_rect ( 0 , 0 ) ; let mut blitter = RasterPipelineBlitter :: new ( paint , clip_mask , pixmap ) ? ; if paint . anti_alias { scan :: path_aa :: fill_path ( path , fill_type , & clip_rect , & mut blitter ) } else { scan :: path :: fill_path ( path , fill_type , & clip_rect , & mut blitter ) } }
Draws a filled path onto the pixmap.
Draws a filled path onto the pixmap .
path
&Path
paint
&Paint
fill_type
FillRule
clip_mask
Option<&ClipMaskData>
pixmap
&mut PixmapMut