1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
use crate::{Canvas, OwnedCanvas};
use skia_bindings as sb;

impl Canvas {
    pub fn new_null() -> OwnedCanvas<'static> {
        new_null_canvas()
    }
}

pub fn new_null_canvas() -> OwnedCanvas<'static> {
    Canvas::own_from_native_ptr(unsafe { sb::C_SkMakeNullCanvas() }).unwrap()
}

#[test]
fn test_create_null_canvas() {
    let nc = new_null_canvas();
    drop(nc);
}