1use skia_bindings as sb;
2use std::ptr;
3
4pub use skia_bindings::GrBackendApi as BackendAPI;
5variant_name!(BackendAPI::OpenGL);
6
7pub use skia_bindings::GrSurfaceOrigin as SurfaceOrigin;
8variant_name!(SurfaceOrigin::BottomLeft);
9
10// Note: BackendState is in gl/types.rs/
11
12#[repr(C)]
13#[allow(dead_code)]
14#[derive(Debug)]
15pub struct FlushInfo {
16 // TODO: wrap access to the following fields in a safe way:
17 num_semaphores: usize,
18 signal_semaphores: *mut sb::GrBackendSemaphore,
19 finished_proc: sb::GrGpuFinishedProc,
20 finished_context: sb::GrGpuFinishedContext,
21 submitted_proc: sb::GrGpuSubmittedProc,
22 submitted_context: sb::GrGpuSubmittedContext,
23}
24
25impl Default for FlushInfo {
26 fn default() -> Self {
27 Self {
28 num_semaphores: 0,
29 signal_semaphores: ptr::null_mut(),
30 finished_proc: None,
31 finished_context: ptr::null_mut(),
32 submitted_proc: None,
33 submitted_context: ptr::null_mut(),
34 }
35 }
36}
37
38native_transmutable!(sb::GrFlushInfo, FlushInfo, flush_info_layout);
39
40pub use sb::GrSemaphoresSubmitted as SemaphoresSubmitted;
41variant_name!(SemaphoresSubmitted::Yes);
42
43pub use sb::GrPurgeResourceOptions as PurgeResourceOptions;
44variant_name!(PurgeResourceOptions::AllResources);
45
46pub use sb::GrSyncCpu as SyncCpu;
47variant_name!(SyncCpu::Yes);
48