Fix for native child widget performance issue.

Flushing native child widgets in VG and GL window
surfaces caused performance downgrade because unnecessary
swapBuffers calls. On Symbian we must not support flushing
native child widgets in VG and GL window surfaces because
it causes GPU memory overhead and performance issues. Symbian
graphics architecture allows us to render native child widgets
to TLW EGL surface correctly in most of the cases.

Task-number: QTMOBILITY-1570
Reviewed-by: Samuel Rødal
(cherry picked from commit 6a92de7c89764848f7a85b1aa412a07bedc72b1a)
This commit is contained in:
Jani Hautakangas 2011-05-02 12:22:24 +03:00 committed by Olivier Goffart
parent 95e57339a9
commit 806873f9af
2 changed files with 22 additions and 0 deletions

View File

@ -610,6 +610,17 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
if (!d_ptr->destructive_swap_buffers && !d_ptr->did_paint)
return;
#ifdef Q_OS_SYMBIAN
if (window() != widget) {
// For performance reasons we don't support
// flushing native child widgets on Symbian.
// It breaks overlapping native child widget
// rendering in some cases but we prefer performance.
return;
}
#endif
QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget();
Q_ASSERT(parent);

View File

@ -78,6 +78,17 @@ QPaintDevice *QVGWindowSurface::paintDevice()
void QVGWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &offset)
{
Q_UNUSED(offset);
#ifdef Q_OS_SYMBIAN
if (window() != widget) {
// For performance reasons we don't support
// flushing native child widgets on Symbian.
// It breaks overlapping native child widget
// rendering in some cases but we prefer performance.
return;
}
#endif
QWidget *parent = widget->internalWinId() ? widget : widget->nativeParentWidget();
d_ptr->endPaint(parent, region);
}