skia-org: reorder drivers
@@ -68,6 +68,17 @@ pub(crate) mod artifact {
}
}
+ impl DrawingDriver for PDF {
+ const NAME: &'static str = "pdf";
+
+ fn draw_image<F>(size: (i32, i32), path: &PathBuf, name: &str, func: F) -> () where F: Fn(&mut Canvas) -> () {
+ let mut document = skia_safe::pdf::new_document(None).begin_page((size.0 as _, size.1 as _), None);
+ func(document.canvas());
+ let data = document.end_page().close();
+ write_file(data.bytes(), path, name, "pdf");
+ }
+ }
+
impl DrawingDriver for OpenGL {
const NAME: &'static str = "opengl";
@@ -129,17 +140,6 @@ pub(crate) mod artifact {
}
}
- impl DrawingDriver for PDF {
- const NAME: &'static str = "pdf";
-
- fn draw_image<F>(size: (i32, i32), path: &PathBuf, name: &str, func: F) -> () where F: Fn(&mut Canvas) -> () {
- let mut document = skia_safe::pdf::new_document(None).begin_page((size.0 as _, size.1 as _), None);
- func(document.canvas());
- let data = document.end_page().close();
- write_file(data.bytes(), path, name, "pdf");
- }
- }
-
fn draw_image_on_surface<F>(surface: &mut Surface, path: &PathBuf, name: &str, func: F)
where F: Fn(&mut Canvas) -> () {
