1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#[cfg(feature = "vulkan-backend")]
use ash::vk;
/// Errors that can occur during SVG rendering.
#[derive(Debug, thiserror::Error)]
pub enum SvgRenderError {
/// The requested render dimensions are zero or exceed `i32::MAX`.
#[error("invalid render size {width}x{height}")]
InvalidSize { width: u32, height: u32 },
/// Pipeline worker count is 0; at least 1 worker is required.
#[error("invalid pipeline worker count {workers}; expected at least 1")]
InvalidWorkerCount { workers: usize },
/// Failed to load the Vulkan shared library (e.g. `vulkan-1.dll`).
#[cfg(feature = "vulkan-backend")]
#[error("failed to load Vulkan loader: {0}")]
VulkanLoader(#[from] ash::LoadingError),
/// A raw Vulkan API call returned an error code.
#[cfg(feature = "vulkan-backend")]
#[error("Vulkan call failed: {0:?}")]
Vulkan(#[from] vk::Result),
/// No physical device with a graphics queue family was found.
#[cfg(feature = "vulkan-backend")]
#[error("no Vulkan physical device with graphics queue was found")]
NoVulkanDevice,
/// Skia failed to create a Vulkan-backed direct rendering context.
#[cfg(feature = "vulkan-backend")]
#[error("failed to create Skia Vulkan direct context")]
SkiaContext,
/// The SVG document could not be parsed by Skia's SVG DOM parser.
#[error("failed to parse SVG")]
SvgParse,
/// Skia failed to allocate the raster or GPU render target surface.
#[error("failed to create render target")]
RenderTarget,
/// Pixel readback from the render surface failed.
#[error("failed to read pixels from render target")]
ReadPixels,
/// PNG encoding via Skia failed.
#[error("failed to encode PNG")]
PngEncode,
/// JPEG encoding via Skia failed.
#[error("failed to encode JPEG")]
JpegEncode,
/// WebP encoding via Skia failed.
#[error("failed to encode WebP")]
WebpEncode,
/// The pipeline worker thread exited before the render job completed.
#[error("pipeline renderer worker stopped before completing the render job")]
PipelineClosed,
}