freya::common::elements

Trait ElementUtils

pub trait ElementUtils {
    // Required method
    fn render(
        self,
        layout_node: &LayoutNode,
        node_ref: &NodeRef<'_, CustomAttributeValues>,
        canvas: &Canvas,
        font_collection: &mut RCHandle<skia_textlayout_FontCollection>,
        font_manager: &RCHandle<SkFontMgr>,
        fallback_fonts: &[String],
        images_cache: &mut ImagesCache,
        scale_factor: f32,
    );

    // Provided methods
    fn is_point_inside_area(
        &self,
        point: &Point2D<f64, ()>,
        _node_ref: &NodeRef<'_, CustomAttributeValues>,
        layout_node: &LayoutNode,
        _scale_factor: f32,
    ) -> bool { ... }
    fn clip(
        &self,
        _layout_node: &LayoutNode,
        _node_ref: &NodeRef<'_, CustomAttributeValues>,
        _canvas: &Canvas,
        _scale_factor: f32,
    ) { ... }
    fn element_drawing_area(
        &self,
        layout_node: &LayoutNode,
        _node_ref: &NodeRef<'_, CustomAttributeValues>,
        _scale_factor: f32,
        _node_style: &StyleState,
    ) -> Rect<f32, ()> { ... }
    fn element_needs_cached_area(
        &self,
        _node_ref: &NodeRef<'_, CustomAttributeValues>,
        _style_state: &StyleState,
    ) -> bool { ... }
}

Required Methods§

fn render( self, layout_node: &LayoutNode, node_ref: &NodeRef<'_, CustomAttributeValues>, canvas: &Canvas, font_collection: &mut RCHandle<skia_textlayout_FontCollection>, font_manager: &RCHandle<SkFontMgr>, fallback_fonts: &[String], images_cache: &mut ImagesCache, scale_factor: f32, )

Provided Methods§

fn is_point_inside_area( &self, point: &Point2D<f64, ()>, _node_ref: &NodeRef<'_, CustomAttributeValues>, layout_node: &LayoutNode, _scale_factor: f32, ) -> bool

fn clip( &self, _layout_node: &LayoutNode, _node_ref: &NodeRef<'_, CustomAttributeValues>, _canvas: &Canvas, _scale_factor: f32, )

fn element_drawing_area( &self, layout_node: &LayoutNode, _node_ref: &NodeRef<'_, CustomAttributeValues>, _scale_factor: f32, _node_style: &StyleState, ) -> Rect<f32, ()>

fn element_needs_cached_area( &self, _node_ref: &NodeRef<'_, CustomAttributeValues>, _style_state: &StyleState, ) -> bool

Check if this element requires any kind of special caching. Mainly used for text-like elements with shadows. See crate::render::CompositorCache. Default to false.

Implementors§