diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-14 16:58:41 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-14 16:58:41 (GMT) |
commit | 1931d12c53563ccd6516c720781784079efaec3c (patch) | |
tree | d432c0c0d81150293070fb03516f45f4c3f4aa6b | |
parent | cfee61fd74d7fe73f0de13356fe683bc8ae91f92 (diff) | |
parent | 0047fd3703fcec3afbbaff13e7a2d96d60f3f8f4 (diff) | |
download | Qt-1931d12c53563ccd6516c720781784079efaec3c.zip Qt-1931d12c53563ccd6516c720781784079efaec3c.tar.gz Qt-1931d12c53563ccd6516c720781784079efaec3c.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Enable surface transparency support on Symbian^4.
Improve the behavior of expose events on Symbian.
-rw-r--r-- | src/corelib/global/qglobal.h | 4 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 11 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 9 | ||||
-rw-r--r-- | src/gui/painting/qwindowsurface_s60.cpp | 8 |
5 files changed, 28 insertions, 5 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 52e9845..f350d1a 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -2419,6 +2419,10 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf(); //enabling new graphics resources #define QT_SYMBIAN_SUPPORTS_SGIMAGE #define QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER + +#ifdef SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS +#define Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE +#endif #endif diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 3ee0a71..8c77728 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -807,6 +807,15 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const void QSymbianControl::Draw(const TRect& controlRect) const { + // Set flag to avoid calling DrawNow in window surface + QWExtra *extra = qwidget->d_func()->extraData(); + if (extra && !extra->inExpose) { + extra->inExpose = true; + QRect exposeRect = qt_TRect2QRect(controlRect); + qwidget->d_func()->syncBackingStore(exposeRect); + extra->inExpose = false; + } + QWindowSurface *surface = qwidget->windowSurface(); QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL; @@ -855,8 +864,6 @@ void QSymbianControl::Draw(const TRect& controlRect) const default: Q_ASSERT(false); } - } else { - surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint()); } if (sendNativePaintEvents) { diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h index ec8d20f..b1eb3c3 100644 --- a/src/gui/kernel/qwidget_p.h +++ b/src/gui/kernel/qwidget_p.h @@ -229,6 +229,7 @@ struct QWExtra { #endif #elif defined(Q_OS_SYMBIAN) // <----------------------------------------------------- Symbian uint activated : 1; // RWindowBase::Activated has been called + uint inExpose : 1; // Prevents drawing recursion /** * Defines the behaviour of QSymbianControl::Draw. diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index c65a162..00f2213 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -389,9 +389,13 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de if (!isOpaque) { RWindow *const window = static_cast<RWindow *>(drawableWindow); +#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE + window->SetSurfaceTransparency(true); +#else const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); if (window->SetTransparencyAlphaChannel() == KErrNone) window->SetBackgroundColor(TRgb(255, 255, 255, 0)); +#endif } } @@ -707,12 +711,16 @@ void QWidgetPrivate::s60UpdateIsOpaque() RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow()); +#ifdef Q_SYMBIAN_SEMITRANSPARENT_BG_SURFACE + window->SetSurfaceTransparency(!isOpaque); +#else if (!isOpaque) { const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA)); if (window->SetTransparencyAlphaChannel() == KErrNone) window->SetBackgroundColor(TRgb(255, 255, 255, 0)); } else window->SetTransparentRegion(TRegionFix<1>()); +#endif } void QWidgetPrivate::setWindowIcon_sys(bool forceReset) @@ -883,6 +891,7 @@ void QWidgetPrivate::createSysExtra() extra->activated = 0; extra->nativePaintMode = QWExtra::Default; extra->receiveNativePaintEvents = 0; + extra->inExpose = 0; } void QWidgetPrivate::deleteSysExtra() diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index b8eaead..b41dc2c 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -145,10 +145,12 @@ QImage* QS60WindowSurface::buffer(const QWidget *widget) void QS60WindowSurface::flush(QWidget *widget, const QRegion ®ion, const QPoint &) { - const QVector<QRect> subRects = region.rects(); - for (int i = 0; i < subRects.count(); ++i) { - TRect tr = qt_QRect2TRect(subRects[i]); + QWExtra *extra = widget->d_func()->extraData(); + if (extra && !extra->inExpose) { + extra->inExpose = true; // Prevent DrawNow() from calling syncBackingStore() again + TRect tr = qt_QRect2TRect(region.boundingRect()); widget->winId()->DrawNow(tr); + extra->inExpose = false; } } |