From 6a92de7c89764848f7a85b1aa412a07bedc72b1a Mon Sep 17 00:00:00 2001 From: Jani Hautakangas Date: Mon, 2 May 2011 12:22:24 +0300 Subject: Fix for native child widget performance issue. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/opengl/qwindowsurface_gl.cpp | 11 +++++++++++ src/openvg/qwindowsurface_vg.cpp | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index b056caa..c6cb214 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -604,6 +604,17 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & if (!hasPartialUpdateSupport() && !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); diff --git a/src/openvg/qwindowsurface_vg.cpp b/src/openvg/qwindowsurface_vg.cpp index 9ce7f9a..01a6ce9 100644 --- a/src/openvg/qwindowsurface_vg.cpp +++ b/src/openvg/qwindowsurface_vg.cpp @@ -79,6 +79,17 @@ QPaintDevice *QVGWindowSurface::paintDevice() void QVGWindowSurface::flush(QWidget *widget, const QRegion ®ion, 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); } -- cgit v0.12