summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-01-22 17:34:03 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-02-05 16:27:59 +0000
commit28cf5ae000de36cd6ad0df942c2f99bfa7e22129 (patch)
treee92cc184da9ff1f33bf38d47f1d062471cb94196
parent35f6f530bfa3877dfdf763ab1cdb1d63cc66c6d2 (diff)
macOS: Share view update code between layered and non-layered mode
Change-Id: I8eaf0607c1ede18ed20180fd43cc93744c99962d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index e3bee95ad9..3e3e9aac1a 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -334,7 +334,11 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
exposedRegion += QRectF::fromCGRect(dirtyRects[i]).toRect();
qCDebug(lcQpaCocoaWindow) << "[QNSView drawRect:]" << m_platformWindow->window() << exposedRegion;
+ [self updateRegion:exposedRegion];
+}
+- (void)updateRegion:(QRegion)dirtyRegion
+{
#ifndef QT_NO_OPENGL
if (m_glContext && m_shouldSetGLContextinDrawRect) {
[m_glContext->nsOpenGLContext() setView:self];
@@ -350,7 +354,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
windowPrivate->deliverUpdateRequest();
m_updateRequested = false;
} else {
- m_platformWindow->handleExposeEvent(exposedRegion);
+ m_platformWindow->handleExposeEvent(dirtyRegion);
}
if (windowPrivate->updateRequestPending) {
@@ -376,7 +380,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet")
qCDebug(lcQpaCocoaWindow) << "[QNSView updateLayer]" << m_platformWindow->window();
// FIXME: Find out if there's a way to resolve the dirty rect like in drawRect:
- m_platformWindow->handleExposeEvent(QRectF::fromCGRect(self.bounds).toRect());
+ [self updateRegion:QRectF::fromCGRect(self.bounds).toRect()];
}
- (void)viewDidChangeBackingProperties