summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qcocoaview_mac.mm
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2011-02-14 16:23:00 +0100
committerFabien Freling <fabien.freling@nokia.com>2011-02-15 13:49:38 +0100
commit78c5c1cae5f9e100bfb7388f68208406f0db4b42 (patch)
tree3dc89f26963c084ead61ec0ccefac9981e94866c /src/gui/kernel/qcocoaview_mac.mm
parent7da16ed9888133039c6d7a261fc7c4b61d9b6114 (diff)
Optimize the rendering path for the unified toolbar.
The over flushing of the toolbar had a huge performance impact so now we only flush the toolbar when necessary and moved the rendering out of the flushing process. Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src/gui/kernel/qcocoaview_mac.mm')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index e50c401d2e..1fe96f81dd 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -581,20 +581,12 @@ static int qCocoaViewCount = 0;
} else {
- QUnifiedToolbarSurface *unifiedSurface = dynamic_cast<QUnifiedToolbarSurface *>(qwidgetprivate->unifiedSurface);
+ QUnifiedToolbarSurface *unifiedSurface = qwidgetprivate->unifiedSurface;
if (!unifiedSurface || !qwidgetprivate->flushRequested) {
qt_mac_release_graphics_context(context);
return;
}
- // We render the content of the toolbar in the surface.
- unifiedSurface->updateToolbarOffset(qwidget);
- QRect beginPaintRect(qwidgetprivate->toolbar_offset.x(), qwidgetprivate->toolbar_offset.y(), qwidget->geometry().width(), qwidget->geometry().height());
- QRegion beginPaintRegion(beginPaintRect);
-
- unifiedSurface->beginPaint(beginPaintRegion);
- qwidget->render(unifiedSurface->paintDevice(), qwidgetprivate->toolbar_offset, QRegion(), QWidget::DrawChildren);
-
int areaX = qwidgetprivate->toolbar_offset.x();
int areaY = qwidgetprivate->toolbar_offset.y();
int areaWidth = qwidget->geometry().width();