1mod backend_drawable_info;
2mod backend_surface;
3pub mod context_options;
4#[cfg(feature = "d3d")]
5pub mod d3d;
6mod direct_context;
7mod driver_bug_workarounds;
8mod ganesh;
9#[cfg(feature = "gl")]
10pub mod gl;
11mod gpu_types;
12#[cfg(feature = "metal")]
13pub mod mtl;
14mod mutable_texture_state;
15mod recording_context;
16mod types;
17#[cfg(feature = "vulkan")]
18pub mod vk;
19mod yuva_backend_textures;
20
21pub use backend_drawable_info::*;
22pub use backend_surface::*;
23pub use context_options::ContextOptions;
24pub use direct_context::*;
25pub use driver_bug_workarounds::DriverBugWorkarounds;
26pub use ganesh::image_ganesh as images;
27pub use gpu_types::*;
28pub use mutable_texture_state::*;
29pub use recording_context::*;
30pub use types::*;
31pub use yuva_backend_textures::*;
32
33#[deprecated(since = "0.37.0", note = "Use RecordingContext or DirectContext")]
34pub type Context = DirectContext;
35
36pub mod surfaces {
37 #[cfg(feature = "metal")]
38 pub use super::ganesh::mtl::*;
39 pub use super::ganesh::surface_ganesh::*;
40}
41
42pub mod backend_formats {
43 #[cfg(feature = "gl")]
44 pub use super::ganesh::gl::backend_formats::*;
45 #[cfg(feature = "vulkan")]
46 pub use super::ganesh::vk::backend_formats::*;
47}
48
49pub mod backend_textures {
50 #[cfg(feature = "gl")]
51 pub use super::ganesh::gl::backend_textures::*;
52 #[cfg(feature = "vulkan")]
53 pub use super::ganesh::vk::backend_textures::*;
54}
55
56pub mod backend_render_targets {
57 #[cfg(feature = "gl")]
58 pub use super::ganesh::gl::backend_render_targets::*;
59 #[cfg(feature = "vulkan")]
60 pub use super::ganesh::vk::backend_render_targets::*;
61}
62
63pub mod direct_contexts {
64 #[cfg(feature = "gl")]
65 pub use super::ganesh::gl::direct_contexts::*;
66 #[cfg(feature = "vulkan")]
67 pub use super::ganesh::vk::direct_contexts::*;
68}
69
70#[cfg(test)]
71mod tests {
72 use super::{DirectContext, RecordingContext};
73
74 #[test]
75 fn implicit_deref_conversion_from_direct_context_to_context_to_recording_context() {
76 fn _recording_context(_context: &RecordingContext) {}
77 fn _context(context: &DirectContext) {
78 _recording_context(context)
79 }
80 fn _direct_context(context: &DirectContext) {
81 _context(context)
82 }
83
84 fn _recording_context_mut(_context: &mut RecordingContext) {}
85 fn _context_mut(context: &mut DirectContext) {
86 _recording_context_mut(context)
87 }
88 fn _direct_context_mut(context: &mut DirectContext) {
89 _context_mut(context)
90 }
91 }
92}
93