skia_safe/gpu/ganesh/gl/
direct_context.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pub mod direct_contexts {
    use skia_bindings as sb;

    use crate::{
        gpu::{gl, ContextOptions, DirectContext},
        prelude::*,
    };

    pub fn make_gl<'a>(
        interface: impl Into<gl::Interface>,
        options: impl Into<Option<&'a ContextOptions>>,
    ) -> Option<DirectContext> {
        DirectContext::from_ptr(unsafe {
            sb::C_GrDirectContext_MakeGL(
                interface.into().into_ptr(),
                options.into().native_ptr_or_null(),
            )
        })
    }
}