pub struct RenderDataStream { /* private fields */ }Expand description
A recorded sequence of drawing operations with its resource table.
Implementations§
Source§impl RenderDataStream
impl RenderDataStream
pub fn new() -> Self
Sourcepub fn opcode_length(&self) -> usize
pub fn opcode_length(&self) -> usize
The number of bytes recorded: the position a later
rewind can return to.
pub fn resource_count(&self) -> usize
pub fn get_resource(&self, handle: i32) -> Option<&RenderDataResource>
Sourcepub fn rewind(&mut self, length: usize, depth: i32)
pub fn rewind(&mut self, length: usize, depth: i32)
Drops everything recorded after position length and restores the
scope depth.
Sourcepub fn dispose_resources(&self)
pub fn dispose_resources(&self)
Releases the resources the stream holds a reference to on behalf of their owners.
pub fn draw_line( &mut self, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, p1: Point, p2: Point, )
pub fn draw_rectangle( &mut self, server_brush: Option<RenderDataResource>, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, rect: RoundedRect, box_shadows: &BoxShadows, )
pub fn draw_ellipse( &mut self, server_brush: Option<RenderDataResource>, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, rect: Rect, )
pub fn draw_geometry( &mut self, server_brush: Option<RenderDataResource>, server_pen: Option<RenderDataResource>, client_pen: Option<RenderDataResource>, geometry: Option<RenderDataResource>, )
Sourcepub fn draw_glyph_run(
&mut self,
server_brush: Option<RenderDataResource>,
glyph_run: Option<Arc<dyn IGlyphRunImpl>>,
)
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()).
Sourcepub fn draw_bitmap(
&mut self,
bitmap: Option<RefCounted<SharedBitmapImpl>>,
opacity: f64,
source_rect: Rect,
dest_rect: Rect,
)
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()).
pub fn draw_custom(&mut self, operation: Option<Arc<dyn ICustomDrawOperation>>)
pub fn push_clip(&mut self, clip: RoundedRect)
pub fn push_geometry_clip(&mut self, geometry: Option<RenderDataResource>)
pub fn push_opacity(&mut self, opacity: f64)
pub fn push_opacity_mask( &mut self, server_brush: Option<RenderDataResource>, bounds: Rect, )
pub fn push_transform(&mut self, matrix: Matrix)
pub fn push_render_options(&mut self, options: RenderOptions)
pub fn push_text_options(&mut self, text_options: TextOptions)
pub fn push_effect( &mut self, effect: Option<Arc<dyn IImmutableEffect>>, bounds: Rect, )
pub fn pop(&mut self)
Sourcepub fn serialize_to(&self, writer: &mut BatchStreamWriter<'_>)
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.
Sourcepub fn deserialize_from(
&mut self,
reader: &mut BatchStreamReader<'_>,
resolve: &dyn Fn(ServerObjectId) -> Option<Rc<dyn IServerObject>>,
)
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.
Sourcepub fn visit<V: IRenderDataVisitor>(&self, visitor: &mut V)
pub fn visit<V: IRenderDataVisitor>(&self, visitor: &mut V)
Walks the recorded operations.
Sourcepub fn visit_with_scopes<V: IRenderDataVisitor>(
&self,
visitor: &mut V,
scopes: &mut Vec<V::Scope>,
)
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§impl RenderDataStream
impl RenderDataStream
Sourcepub fn calculate_bounds(&self) -> Option<Rect>
pub fn calculate_bounds(&self) -> Option<Rect>
The bounds of everything the stream draws, or None if it draws
nothing.
Source§impl RenderDataStream
impl RenderDataStream
Sourcepub fn hit_test_geometry(&self, geometry: &Ref<Geometry>) -> IntersectionResult
pub fn hit_test_geometry(&self, geometry: &Ref<Geometry>) -> IntersectionResult
How the recorded content intersects a geometry.
Source§impl RenderDataStream
impl RenderDataStream
Sourcepub fn replay(&self, context: &mut dyn IDrawingContextImpl)
pub fn replay(&self, context: &mut dyn IDrawingContextImpl)
Replays the recorded operations onto a platform drawing context.
Sourcepub fn replay_with_scopes(
&self,
context: &mut dyn IDrawingContextImpl,
scopes: &mut Vec<ReplayScope>,
)
pub fn replay_with_scopes( &self, context: &mut dyn IDrawingContextImpl, scopes: &mut Vec<ReplayScope>, )
Like replay, with a reusable scope stack.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RenderDataStream
impl !Send for RenderDataStream
impl !Sync for RenderDataStream
impl !UnwindSafe for RenderDataStream
impl Freeze for RenderDataStream
impl Unpin for RenderDataStream
impl UnsafeUnpin for RenderDataStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more