1 | mod backend_drawable_info; |
2 | mod backend_surface; |
3 | pub mod context_options; |
4 | #[cfg (feature = "d3d" )] |
5 | pub mod d3d; |
6 | mod direct_context; |
7 | mod driver_bug_workarounds; |
8 | mod ganesh; |
9 | #[cfg (feature = "gl" )] |
10 | pub mod gl; |
11 | mod gpu_types; |
12 | #[cfg (feature = "metal" )] |
13 | pub mod mtl; |
14 | mod mutable_texture_state; |
15 | mod recording_context; |
16 | mod types; |
17 | #[cfg (feature = "vulkan" )] |
18 | pub mod vk; |
19 | mod yuva_backend_textures; |
20 | |
21 | pub use backend_drawable_info::*; |
22 | pub use backend_surface::*; |
23 | pub use context_options::ContextOptions; |
24 | pub use direct_context::*; |
25 | pub use driver_bug_workarounds::DriverBugWorkarounds; |
26 | pub use ganesh::image_ganesh as images; |
27 | pub use gpu_types::*; |
28 | pub use mutable_texture_state::*; |
29 | pub use recording_context::*; |
30 | pub use types::*; |
31 | pub use yuva_backend_textures::*; |
32 | |
33 | #[deprecated (since = "0.37.0" , note = "Use RecordingContext or DirectContext" )] |
34 | pub type Context = DirectContext; |
35 | |
36 | pub mod surfaces { |
37 | #[cfg (feature = "metal" )] |
38 | pub use super::ganesh::mtl::*; |
39 | pub use super::ganesh::surface_ganesh::*; |
40 | } |
41 | |
42 | pub 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 | |
49 | pub 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 | |
56 | pub 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 | |
63 | pub 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)] |
71 | mod 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 | |