summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsurface.h
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2018-04-04 14:11:43 +0200
committerMorten Johan Sørvig <morten.sorvig@qt.io>2018-05-11 09:13:55 +0000
commitee60a044c9afeab408085cac0214e0c3cf8b837a (patch)
treebabeb849c7cd8ff192ec4ed753caf3f5b81b71cc /src/gui/kernel/qsurface.h
parent1332cca091bfa93da6e7c8983428909890fd6ccb (diff)
macOS: Add QSurfaceType::MetalSurface
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<CAMetalLayer *>( reinterpret_cast<NSView *>(window->winId()).layer); Change-Id: I514f5186133c3e610fd4e53ca91fe9c85c6d016e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel/qsurface.h')
-rw-r--r--src/gui/kernel/qsurface.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qsurface.h b/src/gui/kernel/qsurface.h
index 7e09449d12..e3e5106e3a 100644
--- a/src/gui/kernel/qsurface.h
+++ b/src/gui/kernel/qsurface.h
@@ -66,7 +66,8 @@ public:
OpenGLSurface,
RasterGLSurface,
OpenVGSurface,
- VulkanSurface
+ VulkanSurface,
+ MetalSurface
};
virtual ~QSurface();