diff options
author | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2010-01-18 08:14:12 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2010-02-04 09:11:03 (GMT) |
commit | 04e34fe3aecca482abeeabe2e31778e9102eeb08 (patch) | |
tree | 89a10ac1baa65306c26c61886397912755e00af3 /src/gui/kernel/qwidget.cpp | |
parent | 3e6b22f138ad5b592dedbca99f91fdf612f20cea (diff) | |
download | Qt-04e34fe3aecca482abeeabe2e31778e9102eeb08.zip Qt-04e34fe3aecca482abeeabe2e31778e9102eeb08.tar.gz Qt-04e34fe3aecca482abeeabe2e31778e9102eeb08.tar.bz2 |
Improve raster graphics system performance on Mac (second try).
This fixes the qmlviewer "sluggish animations and lost
mouse events" issue by making sure we don't block and
wait for for the screen refresh when flushing the
backing store to the screen.
NB: This commit fixes build issues found in f5f62c0bed.
Review: msorvig
Details:
- Don't force repaints, flush the backingstore in response
to a Cocoa paint/display events only.
- Flush once per window.
- Get the CGContext from the window (don't create a new one)
- Don't call CGContextiFlush on the context.
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index ffad38b..78a25ac 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -1660,7 +1660,13 @@ void QWidgetPrivate::syncBackingStore() repaint_sys(dirty); dirty = QRegion(); } else if (QWidgetBackingStore *bs = maybeBackingStore()) { +#ifdef QT_MAC_USE_COCOA + Q_UNUSED(bs); + void qt_mac_set_needs_display(QWidget *, QRegion); + qt_mac_set_needs_display(q_func(), QRegion()); +#else bs->sync(); +#endif } } @@ -1668,8 +1674,15 @@ void QWidgetPrivate::syncBackingStore(const QRegion ®ion) { if (paintOnScreen()) repaint_sys(region); - else if (QWidgetBackingStore *bs = maybeBackingStore()) + else if (QWidgetBackingStore *bs = maybeBackingStore()) { +#ifdef QT_MAC_USE_COCOA + Q_UNUSED(bs); + void qt_mac_set_needs_display(QWidget *, QRegion); + qt_mac_set_needs_display(q_func(), region); +#else bs->sync(q_func(), region); +#endif + } } void QWidgetPrivate::setUpdatesEnabled_helper(bool enable) |