From c538a333db4b7526fb4d9a82c06296d2492bf000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 29 May 2018 14:19:13 +0200 Subject: [PATCH] macOS: Make layer-backed mode the default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QWindows are still backed by NSViews, but these views render to a CoreAnimation layer instead of directly to the top level NSWindow. This is the direction Apple is going (and is the only available option on iOS/tvOS), so we want to move away from the existing code path as soon as possible. The default can be reversed by setting QT_MAC_WANTS_LAYER=0, or the _q_mac_wantsLayer property on QWindow. [ChangeLog][macOS] Layer-backed mode is now the default for QWindow. Change-Id: Ibb9cc7541b179cad215d0daee14aeb1b54be614c Reviewed-by: Qt CI Bot Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qnsview_drawing.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm index 88c5b595e90..4e6f71973fb 100644 --- a/src/plugins/platforms/cocoa/qnsview_drawing.mm +++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm @@ -147,12 +147,12 @@ // on and off is not a supported use-case, so this code is effectively // returning a constant for the lifetime of our QSNSView, which means // we don't care about emitting KVO signals for @"wantsLayer". - bool layerRequested = qt_mac_resolveOption(false, m_platformWindow->window(), + bool wantsLayer = qt_mac_resolveOption(true, m_platformWindow->window(), "_q_mac_wantsLayer", "QT_MAC_WANTS_LAYER"); bool layerForSurfaceType = [self shouldUseMetalLayer:m_platformWindow->window()->surfaceType()]; - return layerRequested || layerForSurfaceType; + return wantsLayer || layerForSurfaceType; } - (CALayer *)makeBackingLayer