pub struct DisplayRenderer<'a, B: RenderBackend> { /* private fields */ }Expand description
Renders a DisplayTree by implementing
DisplayVisitor and forwarding drawing commands to a RenderBackend.
Implementations§
Source§impl<'a, B: RenderBackend> DisplayRenderer<'a, B>
impl<'a, B: RenderBackend> DisplayRenderer<'a, B>
Sourcepub fn new(
backend: &'a mut B,
surface: &'a mut B::Surface,
page_transform: Matrix,
image_decoder: Option<&'a dyn ImageDecoder>,
) -> Self
pub fn new( backend: &'a mut B, surface: &'a mut B::Surface, page_transform: Matrix, image_decoder: Option<&'a dyn ImageDecoder>, ) -> Self
Create a new renderer targeting the given backend and surface.
Sourcepub fn with_fallback_fonts(self, fonts: Vec<Arc<ResolvedFont>>) -> Self
pub fn with_fallback_fonts(self, fonts: Vec<Arc<ResolvedFont>>) -> Self
Set fallback fonts to use when the primary font is missing a glyph.
Sourcepub fn with_forced_color_scheme(self, scheme: ColorScheme) -> Self
pub fn with_forced_color_scheme(self, scheme: ColorScheme) -> Self
Set a forced color scheme for accessibility rendering.
Sourcepub fn with_per_feature_aa(
self,
text_aa: bool,
path_aa: bool,
image_aa: bool,
) -> Self
pub fn with_per_feature_aa( self, text_aa: bool, path_aa: bool, image_aa: bool, ) -> Self
Set per-feature anti-aliasing flags.
Trait Implementations§
Source§impl<B: RenderBackend> DisplayVisitor for DisplayRenderer<'_, B>
impl<B: RenderBackend> DisplayVisitor for DisplayRenderer<'_, B>
Source§fn enter_group(
&mut self,
blend_mode: BlendMode,
clip: Option<&ClipPath>,
opacity: f32,
isolated: bool,
knockout: bool,
soft_mask: &Option<Box<SoftMask>>,
) -> bool
fn enter_group( &mut self, blend_mode: BlendMode, clip: Option<&ClipPath>, opacity: f32, isolated: bool, knockout: bool, soft_mask: &Option<Box<SoftMask>>, ) -> bool
Called when entering a group node. Read more
Source§fn leave_group(&mut self)
fn leave_group(&mut self)
Called when leaving a group node.
Source§fn visit_path(
&mut self,
ops: &[PathOp],
style: &PathStyle,
matrix: &Matrix,
fill_color: Option<&Color>,
stroke_color: Option<&Color>,
fill_color_space: Option<&ColorSpaceFamily>,
stroke_color_space: Option<&ColorSpaceFamily>,
transfer_function: Option<&TransferFunction>,
overprint: bool,
_overprint_mode: u32,
)
fn visit_path( &mut self, ops: &[PathOp], style: &PathStyle, matrix: &Matrix, fill_color: Option<&Color>, stroke_color: Option<&Color>, fill_color_space: Option<&ColorSpaceFamily>, stroke_color_space: Option<&ColorSpaceFamily>, transfer_function: Option<&TransferFunction>, overprint: bool, _overprint_mode: u32, )
Called for a path node.
Source§fn visit_image(
&mut self,
image_ref: &ImageRef,
matrix: &Matrix,
mask: Option<&ImageMask>,
fill_color: Option<&Color>,
transfer_function: Option<&TransferFunction>,
)
fn visit_image( &mut self, image_ref: &ImageRef, matrix: &Matrix, mask: Option<&ImageMask>, fill_color: Option<&Color>, transfer_function: Option<&TransferFunction>, )
Called for an image node.
Source§fn visit_inline_image(
&mut self,
properties: &HashMap<Name, Operand>,
data: &[u8],
matrix: &Matrix,
)
fn visit_inline_image( &mut self, properties: &HashMap<Name, Operand>, data: &[u8], matrix: &Matrix, )
Called for an inline image node.
Source§fn visit_pattern_fill(
&mut self,
path_ops: &[PathOp],
fill_rule: FillRule,
pattern: &TilingPattern,
pattern_tree: &DisplayTree,
_fill_color: Option<&Color>,
matrix: &Matrix,
)
fn visit_pattern_fill( &mut self, path_ops: &[PathOp], fill_rule: FillRule, pattern: &TilingPattern, pattern_tree: &DisplayTree, _fill_color: Option<&Color>, matrix: &Matrix, )
Called for a pattern fill node.
Source§fn visit_shading_fill(&mut self, shading: &ShadingDict, matrix: &Matrix)
fn visit_shading_fill(&mut self, shading: &ShadingDict, matrix: &Matrix)
Called for a shading fill node.
Source§fn visit_text(&mut self, runs: &[TextRun])
fn visit_text(&mut self, runs: &[TextRun])
Called for a text node.
Auto Trait Implementations§
impl<'a, B> Freeze for DisplayRenderer<'a, B>
impl<'a, B> !RefUnwindSafe for DisplayRenderer<'a, B>
impl<'a, B> Send for DisplayRenderer<'a, B>
impl<'a, B> Sync for DisplayRenderer<'a, B>
impl<'a, B> Unpin for DisplayRenderer<'a, B>
impl<'a, B> UnsafeUnpin for DisplayRenderer<'a, B>
impl<'a, B> !UnwindSafe for DisplayRenderer<'a, B>
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
Mutably borrows from an owned value. Read more