diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-20 13:57:50 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-20 13:57:50 (GMT) |
commit | e050115d8d94eb274c9366c8d2397c11d0e1141b (patch) | |
tree | 33720d13a206dda6cc1ef602a3eff719d8eb0065 /src/gui/kernel | |
parent | dfc61f6b59886f7d223722bf149342cdd46581a8 (diff) | |
parent | a20f6367824dec6c8e48200cc86f9eb7903b6bcb (diff) | |
download | Qt-e050115d8d94eb274c9366c8d2397c11d0e1141b.zip Qt-e050115d8d94eb274c9366c8d2397c11d0e1141b.tar.gz Qt-e050115d8d94eb274c9366c8d2397c11d0e1141b.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fix build error on S60 3.1 environments
QRuntimeGraphicsSystem
Fix replacement functions in platform_paths.prf
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 13 | ||||
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 66 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 1 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 9 |
4 files changed, 85 insertions, 4 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 7b62de1..e60a5f2 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -70,6 +70,10 @@ #include "qmessagebox.h" #include <QtGui/qgraphicsproxywidget.h> +#ifdef QT_GRAPHICSSYSTEM_RUNTIME +#include "private/qgraphicssystem_runtime_p.h" +#endif + #include "qinputcontext.h" #include "qkeymapper_p.h" @@ -1565,7 +1569,14 @@ QStyle* QApplication::setStyle(const QString& style) void QApplication::setGraphicsSystem(const QString &system) { - QApplicationPrivate::graphics_system_name = system; +#ifdef QT_GRAPHICSSYSTEM_RUNTIME + if (QApplicationPrivate::graphics_system_name == QLatin1String("runtime")) { + QRuntimeGraphicsSystem *r = + static_cast<QRuntimeGraphicsSystem *>(QApplicationPrivate::graphics_system); + r->setGraphicsSystem(system); + } else +#endif + QApplicationPrivate::graphics_system_name = system; } /*! diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index fa07b1a..803241e 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -62,6 +62,10 @@ #include "qpaintengine.h" #include "private/qmenubar_p.h" #include "private/qsoftkeymanager_p.h" +#ifdef QT_GRAPHICSSYSTEM_RUNTIME +#include "private/qgraphicssystem_runtime_p.h" +#endif + #include "apgwgnam.h" // For CApaWindowGroupName #include <mdaaudiotoneplayer.h> // For CMdaAudioToneUtility @@ -83,6 +87,10 @@ QT_BEGIN_NAMESPACE +// Goom Events through Window Server +static const int KGoomMemoryLowEvent = 0x10282DBF; +static const int KGoomMemoryGoodEvent = 0x20026790; + #if defined(QT_DEBUG) static bool appNoGrab = false; // Grabbing enabled #endif @@ -922,7 +930,16 @@ void QSymbianControl::Draw(const TRect& controlRect) const const TRect backingStoreRect(TPoint(backingStoreBase.x(), backingStoreBase.y()), controlRect.Size()); if (engine->type() == QPaintEngine::Raster) { - QS60WindowSurface *s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface()); + QS60WindowSurface *s60Surface; +#ifdef QT_GRAPHICSSYSTEM_RUNTIME + if (QApplicationPrivate::graphics_system_name == QLatin1String("runtime")) { + QRuntimeWindowSurface *rtSurface = + static_cast<QRuntimeWindowSurface*>(qwidget->windowSurface()); + s60Surface = static_cast<QS60WindowSurface *>(rtSurface->m_windowSurface); + } else +#endif + s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface()); + CFbsBitmap *bitmap = s60Surface->symbianBitmap(); CWindowGc &gc = SystemGc(); @@ -1805,6 +1822,53 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent } #endif break; + case KGoomMemoryLowEvent: +#ifdef QT_DEBUG + qDebug() << "QApplicationPrivate::symbianProcessWsEvent - KGoomMemoryLowEvent"; +#endif + if (callSymbianEventFilters(symbianEvent)) + return 1; +#ifdef QT_GRAPHICSSYSTEM_RUNTIME + if(QApplicationPrivate::graphics_system_name == QLatin1String("runtime")) { + bool switchToSwRendering(false); + + foreach (QWidget *w, QApplication::topLevelWidgets()) { + if(w->d_func()->topData()->backingStore) { + switchToSwRendering = true; + break; + } + } + + if (switchToSwRendering) { + QRuntimeGraphicsSystem *gs = + static_cast<QRuntimeGraphicsSystem*>(QApplicationPrivate::graphics_system); + + uint memoryUsage = gs->memoryUsage(); + uint memoryForFullscreen = ( S60->screenDepth / 8 ) + * S60->screenWidthInPixels + * S60->screenHeightInPixels; + + S60->memoryLimitForHwRendering = memoryUsage - memoryForFullscreen; + gs->setGraphicsSystem(QLatin1String("raster")); + } + } +#endif + break; + case KGoomMemoryGoodEvent: +#ifdef QT_DEBUG + qDebug() << "QApplicationPrivate::symbianProcessWsEvent - KGoomMemoryGoodEvent"; +#endif + if (callSymbianEventFilters(symbianEvent)) + return 1; +#ifdef QT_GRAPHICSSYSTEM_RUNTIME + if(QApplicationPrivate::graphics_system_name == QLatin1String("runtime")) { + QRuntimeGraphicsSystem *gs = + static_cast<QRuntimeGraphicsSystem*>(QApplicationPrivate::graphics_system); + gs->setGraphicsSystem(QLatin1String("openvg"), S60->memoryLimitForHwRendering); + S60->memoryLimitForHwRendering = 0; + } +#endif + break; default: break; } diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index f560458..232e9b3 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -129,6 +129,7 @@ public: int supportsPremultipliedAlpha : 1; int avkonComponentsSupportTransparency : 1; int menuBeingConstructed : 1; + int memoryLimitForHwRendering; QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type static inline void updateScreenSize(); static inline RWsSession& wsSession(); diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 1f2cd8c..e56ba7b 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -248,9 +248,14 @@ QWidgetPrivate::~QWidgetPrivate() QWindowSurface *QWidgetPrivate::createDefaultWindowSurface() { Q_Q(QWidget); + + QWindowSurface *surface; if (QApplicationPrivate::graphicsSystem()) - return QApplicationPrivate::graphicsSystem()->createWindowSurface(q); - return createDefaultWindowSurface_sys(); + surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q); + else + surface = createDefaultWindowSurface_sys(); + + return surface; } /*! |