1 | use crate::{Canvas, OwnedCanvas}; |
---|---|
2 | use skia_bindings as sb; |
3 | |
4 | impl Canvas { |
5 | pub fn new_null() -> OwnedCanvas<'static> { |
6 | new_null_canvas() |
7 | } |
8 | } |
9 | |
10 | pub fn new_null_canvas() -> OwnedCanvas<'static> { |
11 | Canvas::own_from_native_ptr(native:unsafe { sb::C_SkMakeNullCanvas() }).unwrap() |
12 | } |
13 | |
14 | #[test] |
15 | fn test_create_null_canvas() { |
16 | let nc: OwnedCanvas<'_> = new_null_canvas(); |
17 | drop(nc); |
18 | } |
19 |