Struct i_slint_core::item_rendering::PartialRenderer
source · [−]pub struct PartialRenderer<'a, T> {
pub dirty_region: DirtyRegion,
pub actual_renderer: T,
/* private fields */
}Expand description
Put this structure in the renderer to help with partial rendering
Fields
dirty_region: DirtyRegionThe region of the screen which is considered dirty and that should be repainted
actual_renderer: TThe actual renderer which the drawing call will be forwarded to
Implementations
sourceimpl<'a, T> PartialRenderer<'a, T>
impl<'a, T> PartialRenderer<'a, T>
sourcepub fn new(
cache: &'a RefCell<PartialRenderingCache>,
initial_dirty_region: DirtyRegion,
actual_renderer: T
) -> Self
pub fn new(
cache: &'a RefCell<PartialRenderingCache>,
initial_dirty_region: DirtyRegion,
actual_renderer: T
) -> Self
Create a new PartialRenderer
sourcepub fn compute_dirty_regions(&mut self, component: &ComponentRc, origin: Point)
pub fn compute_dirty_regions(&mut self, component: &ComponentRc, origin: Point)
Visit the tree of item and compute what are the dirty regions
sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Move the actual renderer
Trait Implementations
sourceimpl<'a, T: ItemRenderer> ItemRenderer for PartialRenderer<'a, T>
impl<'a, T: ItemRenderer> ItemRenderer for PartialRenderer<'a, T>
sourcefn filter_item(&mut self, item: Pin<ItemRef<'_>>) -> (bool, Rect)
fn filter_item(&mut self, item: Pin<ItemRef<'_>>) -> (bool, Rect)
This is called before it is being rendered (before the draw_* function). Returns Read more
fn draw_rectangle(&mut self, obj: Pin<&Rectangle>, item_rc: &ItemRc)
fn draw_border_rectangle(&mut self, obj: Pin<&BorderRectangle>, item_rc: &ItemRc)
fn draw_image(&mut self, obj: Pin<&ImageItem>, item_rc: &ItemRc)
fn draw_clipped_image(&mut self, obj: Pin<&ClippedImage>, item_rc: &ItemRc)
fn draw_text(&mut self, obj: Pin<&Text>, item_rc: &ItemRc)
fn draw_text_input(&mut self, obj: Pin<&TextInput>, item_rc: &ItemRc)
fn draw_path(&mut self, obj: Pin<&Path>, item_rc: &ItemRc)
fn draw_box_shadow(&mut self, obj: Pin<&BoxShadow>, item_rc: &ItemRc)
sourcefn combine_clip(&mut self, rect: Rect, radius: Coord, border_width: Coord) -> bool
fn combine_clip(&mut self, rect: Rect, radius: Coord, border_width: Coord) -> bool
Clip the further call until restore_state. radius/border_width can be used for border rectangle clip. (FIXME: consider removing radius/border_width and have another function that take a path instead) Returns a boolean indicating the state of the new clip region: true if the clip region covers an area; false if the clip region is empty. Read more
sourcefn get_current_clip(&self) -> Rect
fn get_current_clip(&self) -> Rect
Get the current clip bounding box in the current transformed coordinate.
fn translate(&mut self, x: Coord, y: Coord)
fn rotate(&mut self, angle_in_degrees: f32)
sourcefn apply_opacity(&mut self, opacity: f32)
fn apply_opacity(&mut self, opacity: f32)
Apply the opacity (between 0 and 1) for all following items until the next call to restore_state.
fn save_state(&mut self)
fn restore_state(&mut self)
sourcefn scale_factor(&self) -> f32
fn scale_factor(&self) -> f32
Returns the scale factor
sourcefn draw_cached_pixmap(
&mut self,
item_rc: &ItemRc,
update_fn: &dyn Fn(&mut dyn FnMut(u32, u32, &[u8]))
)
fn draw_cached_pixmap(
&mut self,
item_rc: &ItemRc,
update_fn: &dyn Fn(&mut dyn FnMut(u32, u32, &[u8]))
)
Draw a pixmap in position indicated by the pos.
The pixmap will be taken from cache if the cache is valid, otherwise, update_fn will be called
with a callback that need to be called once with fn (width, height, data) where data are the
RGBA premultiplied pixel values Read more
sourcefn draw_string(&mut self, string: &str, color: Color)
fn draw_string(&mut self, string: &str, color: Color)
Draw the given string with the specified color at current (0, 0) with the default font. Mainly used by the performance counter overlay. Read more
fn window(&self) -> &Window
fn visit_opacity(
&mut self,
opacity_item: Pin<&Opacity>,
_self_rc: &ItemRc
) -> RenderingResult
fn visit_layer(
&mut self,
_layer_item: Pin<&Layer>,
_self_rc: &ItemRc
) -> RenderingResult
fn visit_clip(
&mut self,
clip_item: Pin<&Clip>,
_self_rc: &ItemRc
) -> RenderingResult
sourcefn metrics(&self) -> RenderingMetrics
fn metrics(&self) -> RenderingMetrics
Returns any rendering metrics collecting since the creation of the renderer (typically per frame) Read more
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for PartialRenderer<'a, T>
impl<'a, T> !Send for PartialRenderer<'a, T>
impl<'a, T> !Sync for PartialRenderer<'a, T>
impl<'a, T> Unpin for PartialRenderer<'a, T>where
T: Unpin,
impl<'a, T> !UnwindSafe for PartialRenderer<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more