summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2014-04-02 08:20:54 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-05 08:15:43 +0200
commita7e8b400d1ca6cf4e23b02564812ea3ff0bb9015 (patch)
treeac5ec48974cd79e70a89ecd21a86e49fe8f71206
parentbd2ec12a7b2787638aa3f7932c20ae4d6577734e (diff)
Cocoa: Make backing store flush accurate.
Flush the individual rects that make up the region instead of the bounding rect. This is required for correctness since then areas not included in the region might not have valid backing store content. The bondingRect() usage here had its roots in an optimization in Qt 4, where it was observed that flushing the bounding rect was more efficient than flushing (many) individual rects. Task-number: QTBUG-37918 Change-Id: Ib805f6713523f9895be24c48466870efaaf89c02 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 1197aa9148..e17cd0a4cc 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -371,8 +371,9 @@ static QTouchDevice *touchDevice = 0;
{
m_backingStore = backingStore;
m_backingStoreOffset = offset * m_backingStore->getBackingStoreDevicePixelRatio();
- QRect br = region.boundingRect();
- [self setNeedsDisplayInRect:NSMakeRect(br.x(), br.y(), br.width(), br.height())];
+ foreach (QRect rect, region.rects()) {
+ [self setNeedsDisplayInRect:NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height())];
+ }
}
- (BOOL) hasMask