From ee60a044c9afeab408085cac0214e0c3cf8b837a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 4 Apr 2018 14:11:43 +0200 Subject: macOS: Add QSurfaceType::MetalSurface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add API to activate previously added Metal layer implementation. This provides minimal support, and unlike VulkanSurface there is no separate QWindow subclass. What this does do is configure the QWindow to use a Metal layer, and to send expose/update events when the layer content should be redrawn. Qt will also update the layer’s drawableSize and contentsScale when needed. Application code can make use of this by accessing the QWindow layer, which will be a CAMetalLayer: CAMetalLayer *metalLayer = reinterpret_cast( reinterpret_cast(window->winId()).layer); Change-Id: I514f5186133c3e610fd4e53ca91fe9c85c6d016e Reviewed-by: Tor Arne Vestbø --- src/gui/kernel/qsurface.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/kernel/qsurface.cpp') diff --git a/src/gui/kernel/qsurface.cpp b/src/gui/kernel/qsurface.cpp index 63651ee8226..415e64b39c4 100644 --- a/src/gui/kernel/qsurface.cpp +++ b/src/gui/kernel/qsurface.cpp @@ -80,6 +80,10 @@ QT_BEGIN_NAMESPACE in conjunction with OpenVG contexts. \value VulkanSurface The surface is a Vulkan compatible surface and can be used in conjunction with the Vulkan graphics API. + \value MetalSurface The surface is a Metal compatible surface and can be used + in conjunction with Apple's Metal graphics API. This surface type is supported + on macOS only. + */ -- cgit v1.2.3