[][src]Enum sixtyfps_corelib::graphics::HighLevelRenderingPrimitive

#[repr(C)]pub enum HighLevelRenderingPrimitive {
    NoContents,
    Rectangle {
        width: f32,
        height: f32,
        border_width: f32,
        border_radius: f32,
    },
    Image {
        source: Resource,
        source_clip_rect: IntRect,
    },
    Text {
        text: SharedString,
        font_request: FontRequest,
    },
    Path {
        width: f32,
        height: f32,
        elements: PathData,
        stroke_width: f32,
    },
    ClipRect {
        width: f32,
        height: f32,
    },
}

The run-time library uses this enum to instruct the GraphicsBackend to render SixtyFPS graphics items. The different variants of this enum closely resemble the properties found in the .60 mark-up language for various items. More specifically this enum typically holds the properties that usually require for the allocation and uploading of GPU side data, such as vertex buffers or textures. Other properties such as colors not part of the enum but are provided to the back-end using RenderingVariable. That means that certain variants of this enum relate to a sequence of rendering variables.

Always absent here are the starting coordinates for the primitives. Those are provided using a translation in the transform parameter of Frame::render_primitive.

Variants

NoContents

There is nothing to draw.

Associated rendering variables: None.

Rectangle

Renders a rectangle with the specified width and height, as well as a border around it. The border_width specifies the width to use for the border, and the border_radius can be used to render a rounded rectangle.

Expected rendering variables:

Fields of Rectangle

width: f32height: f32border_width: f32border_radius: f32
Image

Renders a image referenced by the specified source.

Optional rendering variables:

Fields of Image

source: Resourcesource_clip_rect: IntRect
Text

Renders the specified text with a font that matches the specified family (font_family) and the given pixel size (font_size).

Expected rendering variables:

Fields of Text

text: SharedStringfont_request: FontRequest
Path

Renders a path specified by the elements parameter. The path will be scaled to fit into the given width and height. If the stroke_width is greater than zero, then path will also be outlined.

Expected rendering variables:

Fields of Path

width: f32height: f32elements: PathDatastroke_width: f32
ClipRect

Applies a clip rectangle for all subsequent rendering, with the given width and height. When rendering the low-level rendering primitive created from this variant, [Frame::render_primitive`] will return a vector with cleanup primitives that must be applied in order to unapply the clipping.

Fields of ClipRect

width: f32height: f32

Trait Implementations

impl Debug for HighLevelRenderingPrimitive[src]

impl Default for HighLevelRenderingPrimitive[src]

impl PartialEq<HighLevelRenderingPrimitive> for HighLevelRenderingPrimitive[src]

impl StructuralPartialEq for HighLevelRenderingPrimitive[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.