Skip to main content

RenderDataStream

Struct RenderDataStream 

Source
pub struct RenderDataStream { /* private fields */ }
Expand description

A recorded sequence of drawing operations with its resource table.

Implementations§

Source§

impl RenderDataStream

Source

pub fn new() -> Self

Source

pub fn opcodes(&self) -> &[u8] ⓘ

The recorded operations.

Source

pub fn opcode_length(&self) -> usize

The number of bytes recorded: the position a later rewind can return to.

Source

pub fn depth(&self) -> i32

The current scope depth.

Source

pub fn max_depth(&self) -> i32

The deepest scope nesting recorded.

Source

pub fn resource_count(&self) -> usize

Source

pub fn get_resource(&self, handle: i32) -> Option<&RenderDataResource>

Source

pub fn rewind(&mut self, length: usize, depth: i32)

Drops everything recorded after position length and restores the scope depth.

Source

pub fn dispose_resources(&self)

Releases the resources the stream holds a reference to on behalf of their owners.

Source

pub fn draw_line( &mut self, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, p1: Point, p2: Point, )

Source

pub fn draw_rectangle( &mut self, server_brush: Option<RenderDataResource>, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, rect: RoundedRect, box_shadows: &BoxShadows, )

Source

pub fn draw_ellipse( &mut self, server_brush: Option<RenderDataResource>, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, rect: Rect, )

Source

pub fn draw_geometry( &mut self, server_brush: Option<RenderDataResource>, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, geometry: Option<RenderDataResource>, )

Source

pub fn draw_glyph_run( &mut self, server_brush: Option<RenderDataResource>, glyph_run: Option<Arc<dyn IGlyphRunImpl>>, )

Records a glyph run. The table entry is a new counted reference to it (upstream’s caller passes PlatformImpl.Clone()).

Source

pub fn draw_bitmap( &mut self, bitmap: Option<RefCounted<SharedBitmapImpl>>, opacity: f64, source_rect: Rect, dest_rect: Rect, )

Records a bitmap. The table entry is a new counted reference to it (upstream’s caller passes source.Clone()).

Source

pub fn draw_custom(&mut self, operation: Option<Arc<dyn ICustomDrawOperation>>)

Source

pub fn push_clip(&mut self, clip: RoundedRect)

Source

pub fn push_geometry_clip(&mut self, geometry: Option<RenderDataResource>)

Source

pub fn push_opacity(&mut self, opacity: f64)

Source

pub fn push_opacity_mask( &mut self, server_brush: Option<RenderDataResource>, bounds: Rect, )

Source

pub fn push_transform(&mut self, matrix: Matrix)

Source

pub fn push_render_options(&mut self, options: RenderOptions)

Source

pub fn push_text_options(&mut self, text_options: TextOptions)

Source

pub fn push_effect( &mut self, effect: Option<Arc<dyn IImmutableEffect>>, bounds: Rect, )

Source

pub fn pop(&mut self)

Source

pub fn serialize_to(&self, writer: &mut BatchStreamWriter<'_>)

Writes the stream to a batch. Resources with a server-side counterpart are sent as the counterpart’s id; client-only resources keep their slot but are not sent.

Source

pub fn deserialize_from( &mut self, reader: &mut BatchStreamReader<'_>, resolve: &dyn Fn(ServerObjectId) -> Option<Rc<dyn IServerObject>>, )

Reads a stream from a batch on the server. resolve maps the id of a server object to the object.

Source

pub fn visit<V: IRenderDataVisitor>(&self, visitor: &mut V)

Walks the recorded operations.

Source

pub fn visit_with_scopes<V: IRenderDataVisitor>( &self, visitor: &mut V, scopes: &mut Vec<V::Scope>, )

Walks the recorded operations using a caller-provided scope stack, which lets a caller that visits often reuse the allocation (upstream keeps the scopes on the stack).

Source

pub fn dispose(&mut self)

Releases the stream.

Source§

impl RenderDataStream

Source

pub fn calculate_bounds(&self) -> Option<Rect>

The bounds of everything the stream draws, or None if it draws nothing.

Source§

impl RenderDataStream

Source

pub fn hit_test(&self, point: Point) -> bool

Whether anything recorded is hit at a point.

Source

pub fn hit_test_geometry(&self, geometry: &Ref<Geometry>) -> IntersectionResult

How the recorded content intersects a geometry.

Source§

impl RenderDataStream

Source

pub fn replay(&self, context: &mut dyn IDrawingContextImpl)

Replays the recorded operations onto a platform drawing context.

Source

pub fn replay_with_scopes( &self, context: &mut dyn IDrawingContextImpl, scopes: &mut Vec<ReplayScope>, )

Like replay, with a reusable scope stack.

Trait Implementations§

Source§

impl Default for RenderDataStream

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). 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, 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.