macOS: Don't blend the backingstore unless the window has a background
If there's no background, we should copy the backingstore, so that the backingstore is not blended with the result of the previous flush. The unified toolbar case is covered by the window having a textured background. Task-number: QTBUG-69773 Change-Id: I2f4eed9f44a60ebe7495ce68cf5a54d3d2424b0c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
3068b185c5
commit
bedf50a5bb
@ -162,13 +162,13 @@ void QCocoaBackingStore::flush(QWindow *window, const QRegion ®ion, const QPo
|
||||
|
||||
const qreal devicePixelRatio = m_image.devicePixelRatio();
|
||||
|
||||
// If the flushed window is a content view, and not in unified toolbar mode,
|
||||
// and is fully opaque, we can get away with copying the backingstore instead
|
||||
// of blending.
|
||||
// If the flushed window is a content view, and we're filling the drawn area
|
||||
// completely, or it doesn't have a window background we need to preserve,
|
||||
// we can get away with copying instead of blending the backing store.
|
||||
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
|
||||
const NSCompositingOperation compositingOperation = cocoaWindow->isContentView()
|
||||
&& cocoaWindow->isOpaque() && !windowHasUnifiedToolbar() ?
|
||||
NSCompositingOperationCopy : NSCompositingOperationSourceOver;
|
||||
&& (cocoaWindow->isOpaque() || view.window.backgroundColor == NSColor.clearColor)
|
||||
? NSCompositingOperationCopy : NSCompositingOperationSourceOver;
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
static bool debugBackingStoreFlush = [[NSUserDefaults standardUserDefaults]
|
||||
|
Loading…
x
Reference in New Issue
Block a user