cosmic::iced_renderer

Type Alias Renderer

source
pub type Renderer = Renderer;
Expand description

The default graphics renderer for iced.

Aliased Type§

struct Renderer { /* private fields */ }

Implementations

source§

impl Renderer

source

pub fn new(default_font: Font, default_text_size: Pixels) -> Renderer

source

pub fn layers(&mut self) -> &[Layer]

source

pub fn draw<T>( &mut self, pixels: &mut PixmapMut<'_>, clip_mask: &mut Mask, viewport: &Viewport, damage: &[Rectangle], background_color: Color, overlay: &[T], )
where T: AsRef<str>,

Trait Implementations

source§

impl Debug for Renderer

source§

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

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

impl Default for Renderer

source§

type Compositor = Compositor

The compositor of the renderer.
source§

impl Renderer for Renderer

source§

fn start_layer(&mut self, bounds: Rectangle)

Starts recording a new layer.
source§

fn end_layer(&mut self)

Ends recording a new layer. Read more
source§

fn start_transformation(&mut self, transformation: Transformation)

Starts recording with a new Transformation.
source§

fn end_transformation(&mut self)

Ends recording a new layer. Read more
source§

fn fill_quad(&mut self, quad: Quad, background: impl Into<Background>)

Fills a Quad with the provided Background.
source§

fn clear(&mut self)

Clears all of the recorded primitives in the Renderer.
source§

fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self))

Draws the primitives recorded in the given closure in a new layer. Read more
source§

fn with_transformation( &mut self, transformation: Transformation, f: impl FnOnce(&mut Self), )

Applies a Transformation to the primitives recorded in the given closure.
source§

fn with_translation(&mut self, translation: Vector, f: impl FnOnce(&mut Self))

Applies a translation to the primitives recorded in the given closure.
source§

impl Renderer for Renderer

source§

const ICON_FONT: Font = _

The icon font of the backend.
source§

const CHECKMARK_ICON: char = '\u{f00c}'

The char representing a ✔ icon in the ICON_FONT.
source§

const ARROW_DOWN_ICON: char = '\u{e800}'

The char representing a ▼ icon in the built-in ICON_FONT.
source§

type Font = Font

The font type used.
source§

type Paragraph = Paragraph

The Paragraph of this Renderer.
source§

type Editor = Editor

The Editor of this Renderer.
source§

type Raw = Raw

The Raw of this Renderer.
source§

fn default_font(&self) -> <Renderer as Renderer>::Font

Returns the default Self::Font.
source§

fn default_size(&self) -> Pixels

Returns the default size of Text.
source§

fn fill_paragraph( &mut self, text: &<Renderer as Renderer>::Paragraph, position: Point, color: Color, clip_bounds: Rectangle, )

Draws the given Paragraph at the given position and with the given Color.
source§

fn fill_editor( &mut self, editor: &<Renderer as Renderer>::Editor, position: Point, color: Color, clip_bounds: Rectangle, )

Draws the given Editor at the given position and with the given Color.
source§

fn fill_text( &mut self, text: Text, position: Point, color: Color, clip_bounds: Rectangle, )

Draws the given Text at the given position and with the given Color.
source§

fn fill_raw(&mut self, raw: <Renderer as Renderer>::Raw)

Draws the given Raw
source§

impl Renderer for Renderer

source§

type Geometry = Geometry

The kind of geometry this renderer can draw.
source§

type Frame = Frame

The kind of Frame this renderer supports.
source§

fn new_frame(&self, size: Size) -> <Renderer as Renderer>::Frame

Creates a new Self::Frame.
source§

fn draw_geometry(&mut self, geometry: <Renderer as Renderer>::Geometry)

Draws the given Self::Geometry.
source§

impl Renderer for Renderer

source§

fn draw_mesh(&mut self, _mesh: Mesh)

Draws the given Mesh.
source§

impl Renderer for Renderer

source§

type Handle = Handle

The image Handle to be displayed. Iced exposes its own default implementation of a Handle
source§

fn measure_image(&self, handle: &<Renderer as Renderer>::Handle) -> Size<u32>

Returns the dimensions of an image for the given Handle.
source§

fn draw_image( &mut self, handle: <Renderer as Renderer>::Handle, filter_method: FilterMethod, bounds: Rectangle, rotation: Radians, opacity: f32, border_radius: [f32; 4], )

Draws an image with the given Handle and inside the provided bounds.
source§

impl Renderer for Renderer

source§

fn measure_svg(&self, handle: &Handle) -> Size<u32>

Returns the default dimensions of an SVG for the given Handle.
source§

fn draw_svg(&mut self, svg: Svg, bounds: Rectangle)

Draws an SVG with the given Handle, an optional Color filter, and inside the provided bounds.