Skip to main content

Phase

Enum Phase 

Source
pub enum Phase {
    Clip,
    Color,
    Glyphs,
    Image,
    Shading,
    PathPrep,
    Cull,
    RectTest,
    ZeroScan,
    PathXform,
    Patches,
}
Available on crate feature profiling only.
Expand description

One phase of the walk’s engine-side work.

The set is closed and each variant names a span of code rather than a function, because the question is where the cost is and several of these are spread over more than one call site.

Variants§

§

Clip

crate::clip::resolve: a clip stack reduced to the device calls it becomes, per object. Allocates a Vec<Clip> and, for a non-rectangular entry, a transformed BezPath.

§

Color

crate::color::resolve_argb and the transfer function, per object.

§

Glyphs

crate::text::place_glyphs and its type-3 sibling: the advance arithmetic, the cache lookups, and the per-glyph PlacedGlyph.

§

Image

The image path’s geometry, cache key and pixmap production — everything crate::walk’s image arms do that is not a device call.

§

Shading

The shading path’s own evaluation, likewise.

§

PathPrep

crate::paint::draw_path’s decision tree: the two-point test, the axis-aligned-rectangle test, the zero-area sub-path scan and the stroke split — everything a path object costs above the device call.

§

Cull

The per-object cull test in crate::walk::render_object_list: crate::walk’s object_bbox and the four comparisons against the list’s object-space clip box.

§

RectTest

crate::path::path_rect and snap_rect — draw_path’s case 2, the axis-aligned-rectangle fast path, which runs on every fill-only path object whether or not it is a rectangle.

§

ZeroScan

crate::zero_area::scan_into — draw_path’s case 3, which runs on every fill-only non-glyph path object and on the corpus almost never finds anything.

§

PathXform

The geometry draw_path’s ordinary case hands the device: the path transformed into device space and clamped by crate::path::hard_clip. One reserved BezPath per fill, per object — crate::path::transform_hard_clip fuses the transform and the clamp into a single pass.

§

Patches

crate::shading::draw_patches — the Coons and tensor mesh half of a shading, which rasterizes patch by patch through a scratch device rather than writing a buffer.

It sits beside shading, not inside it: Phase::Shading wraps draw_to_pixmap, which the mesh kinds never reach. Like PathPrep, the span covers the device calls it makes.

Implementations§

Source§

impl Phase

Source

pub const ALL: [Phase; 11]

The phases in the order the arrays index them.

Source

pub const fn index(self) -> usize

The index this phase occupies in Profile::phase_time.

Source

pub const fn name(self) -> &'static str

A short name for a report column.

Trait Implementations§

Source§

impl Clone for Phase

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Phase

Source§

impl Debug for Phase

Source§

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

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

impl Eq for Phase

Source§

impl PartialEq for Phase

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Phase

Auto Trait Implementations§

§

impl Freeze for Phase

§

impl RefUnwindSafe for Phase

§

impl Send for Phase

§

impl Sync for Phase

§

impl Unpin for Phase

§

impl UnsafeUnpin for Phase

§

impl UnwindSafe for Phase

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.