diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-04-02 08:20:54 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-05 08:15:43 +0200 |
commit | a7e8b400d1ca6cf4e23b02564812ea3ff0bb9015 (patch) | |
tree | ac5ec48974cd79e70a89ecd21a86e49fe8f71206 /src/plugins | |
parent | bd2ec12a7b2787638aa3f7932c20ae4d6577734e (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>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 5 |
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 |