From 78c5c1cae5f9e100bfb7388f68208406f0db4b42 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Mon, 14 Feb 2011 16:23:00 +0100 Subject: 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 --- src/gui/kernel/qcocoaview_mac.mm | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/gui/kernel/qcocoaview_mac.mm') 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(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(); -- cgit v1.2.3