pub struct SkiaDevice { /* private fields */ }Expand description
tiny-skia based raster device.
Implementations§
Source§impl SkiaDevice
impl SkiaDevice
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
Create a new device with the given page dimensions and default PNG output.
Defers the full-page pixmap allocation — only a 1×1 placeholder is
created here. The full pixmap is allocated lazily in replay_and_show
only when the non-banded rendering path is needed.
Sourcepub fn with_sink_factory(
width: u32,
height: u32,
sink_factory: Box<dyn PageSinkFactory>,
) -> Self
pub fn with_sink_factory( width: u32, height: u32, sink_factory: Box<dyn PageSinkFactory>, ) -> Self
Create a new device with a custom page sink factory.
Sourcepub fn set_use_viewport_path(&mut self, on: bool)
pub fn set_use_viewport_path(&mut self, on: bool)
Route rendering through the viewport pipeline. Used by the visual
test runner’s --device viewport-png mode.
Sourcepub fn set_layer_set(&mut self, layer_set: LayerSet)
pub fn set_layer_set(&mut self, layer_set: LayerSet)
Replace the device’s OCG visibility overrides.
The empty default has every layer fall back to its
default_visible baked into the display list. Callers building
a layer panel hand in a populated LayerSet each render
pass.
Sourcepub fn layer_set(&self) -> &LayerSet
pub fn layer_set(&self) -> &LayerSet
Read-only view of the device’s current OCG visibility overrides.
Sourcepub fn set_system_cmyk_bytes(&mut self, bytes: Arc<Vec<u8>>)
pub fn set_system_cmyk_bytes(&mut self, bytes: Arc<Vec<u8>>)
Set the system CMYK ICC profile bytes for ICC-aware rendering.
Trait Implementations§
Source§impl Drop for SkiaDevice
Available on crate feature ps-device only.
impl Drop for SkiaDevice
ps-device only.Source§impl OutputDevice for SkiaDevice
Available on crate feature ps-device only.
impl OutputDevice for SkiaDevice
ps-device only.Source§fn fill_path(&mut self, path: &PsPath, params: &FillParams)
fn fill_path(&mut self, path: &PsPath, params: &FillParams)
Source§fn stroke_path(&mut self, path: &PsPath, params: &StrokeParams)
fn stroke_path(&mut self, path: &PsPath, params: &StrokeParams)
Source§fn clip_path(&mut self, path: &PsPath, params: &ClipParams)
fn clip_path(&mut self, path: &PsPath, params: &ClipParams)
Source§fn erase_page(&mut self)
fn erase_page(&mut self)
Source§fn show_page(&mut self, output_path: &str) -> Result<(), String>
fn show_page(&mut self, output_path: &str) -> Result<(), String>
Source§fn draw_image(&mut self, sample_data: &[u8], params: &ImageParams)
fn draw_image(&mut self, sample_data: &[u8], params: &ImageParams)
Source§fn paint_axial_shading(&mut self, params: &AxialShadingParams)
fn paint_axial_shading(&mut self, params: &AxialShadingParams)
Source§fn paint_radial_shading(&mut self, params: &RadialShadingParams)
fn paint_radial_shading(&mut self, params: &RadialShadingParams)
Source§fn paint_mesh_shading(&mut self, params: &MeshShadingParams)
fn paint_mesh_shading(&mut self, params: &MeshShadingParams)
Source§fn paint_patch_shading(&mut self, params: &PatchShadingParams)
fn paint_patch_shading(&mut self, params: &PatchShadingParams)
Source§fn paint_pattern_fill(&mut self, params: &PatternFillParams)
fn paint_pattern_fill(&mut self, params: &PatternFillParams)
Source§fn replay_and_show(
&mut self,
list: DisplayList,
output_path: &str,
) -> Result<(), String>
fn replay_and_show( &mut self, list: DisplayList, output_path: &str, ) -> Result<(), String>
Source§fn finish(&mut self) -> Result<(), String>
fn finish(&mut self) -> Result<(), String>
Source§fn set_trim_box(&mut self, _llx: f64, _lly: f64, _urx: f64, _ury: f64)
fn set_trim_box(&mut self, _llx: f64, _lly: f64, _urx: f64, _ury: f64)
Auto Trait Implementations§
impl !RefUnwindSafe for SkiaDevice
impl !Sync for SkiaDevice
impl !UnwindSafe for SkiaDevice
impl Freeze for SkiaDevice
impl Send for SkiaDevice
impl Unpin for SkiaDevice
impl UnsafeUnpin for SkiaDevice
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more