From 0dd584ae02f052aa19b8745d63793c67474ffc68 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Sun, 11 Feb 2024 00:09:34 -0800 Subject: [PATCH] metal: expose the CAMetalLayer --- blade-graphics/src/metal/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/blade-graphics/src/metal/mod.rs b/blade-graphics/src/metal/mod.rs index a3f136dd..16f299d5 100644 --- a/blade-graphics/src/metal/mod.rs +++ b/blade-graphics/src/metal/mod.rs @@ -406,6 +406,14 @@ impl Context { }, } } + + /// Get the CALayerMetal for this surface, if any. + /// This is platform specific API. + pub fn metal_layer(&self) -> Option { + self.surface + .as_ref() + .map(|suf| suf.lock().unwrap().render_layer.clone()) + } } #[hidden_trait::expose]