summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-05 23:10:19 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-05 23:10:19 (GMT)
commita8ff8e81f7b120e1ecdd434093be075cdd92fb24 (patch)
tree22c16865fb60eff0a7d60bdef96f81bc6b871674 /src
parent1f682526eba54d47deddfac38c37a2bf6e26be66 (diff)
parentbd1aeaa50c60cffa3e195f3f6aed808f23a5c73c (diff)
downloadQt-a8ff8e81f7b120e1ecdd434093be075cdd92fb24.zip
Qt-a8ff8e81f7b120e1ecdd434093be075cdd92fb24.tar.gz
Qt-a8ff8e81f7b120e1ecdd434093be075cdd92fb24.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: Remove the memory tracking attempt from the runtime graphics system.
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qapplication_s60.cpp10
-rw-r--r--src/gui/kernel/qt_s60_p.h2
-rw-r--r--src/gui/painting/qgraphicssystem_runtime.cpp77
-rw-r--r--src/gui/painting/qgraphicssystem_runtime_p.h13
-rw-r--r--src/s60installs/bwins/QtGuiu.def2
-rw-r--r--src/s60installs/eabi/QtGuiu.def2
6 files changed, 6 insertions, 100 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index f8734b2..1f6a4ae 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -1953,13 +1953,6 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
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"));
}
}
@@ -1975,8 +1968,7 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent
if(QApplicationPrivate::runtime_graphics_system) {
QRuntimeGraphicsSystem *gs =
static_cast<QRuntimeGraphicsSystem*>(QApplicationPrivate::graphics_system);
- gs->setGraphicsSystem(QLatin1String("openvg"), S60->memoryLimitForHwRendering);
- S60->memoryLimitForHwRendering = 0;
+ gs->setGraphicsSystem(QLatin1String("openvg"));
}
#endif
break;
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 7f0c99e..a18ea07 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -141,7 +141,6 @@ public:
int supportsPremultipliedAlpha : 1;
int avkonComponentsSupportTransparency : 1;
int menuBeingConstructed : 1;
- int memoryLimitForHwRendering;
QApplication::QS60MainApplicationFactory s60ApplicationFactory; // typedef'ed pointer type
enum ScanCodeState {
@@ -291,7 +290,6 @@ inline QS60Data::QS60Data()
supportsPremultipliedAlpha(0),
avkonComponentsSupportTransparency(0),
menuBeingConstructed(0),
- memoryLimitForHwRendering(0),
s60ApplicationFactory(0)
#ifdef Q_OS_SYMBIAN
,s60InstalledTrapHandler(0)
diff --git a/src/gui/painting/qgraphicssystem_runtime.cpp b/src/gui/painting/qgraphicssystem_runtime.cpp
index 568f4d7..be04df6 100644
--- a/src/gui/painting/qgraphicssystem_runtime.cpp
+++ b/src/gui/painting/qgraphicssystem_runtime.cpp
@@ -53,10 +53,8 @@ QT_BEGIN_NAMESPACE
static int qt_pixmap_serial = 0;
#define READBACK(f) \
- m_graphicsSystem->decreaseMemoryUsage(memoryUsage()); \
f \
- readBackInfo(); \
- m_graphicsSystem->increaseMemoryUsage(memoryUsage()); \
+ readBackInfo();
class QDeferredGraphicsSystemChange : public QObject
@@ -252,14 +250,6 @@ QPixmapData* QRuntimePixmapData::runtimeData() const
return m_data;
}
-uint QRuntimePixmapData::memoryUsage() const
-{
- if(is_null || d == 0)
- return 0;
- return w * h * (d / 8);
-}
-
-
QRuntimeWindowSurface::QRuntimeWindowSurface(const QRuntimeGraphicsSystem *gs, QWidget *window)
: QWindowSurface(window), m_windowSurface(0), m_pendingWindowSurface(0), m_graphicsSystem(gs)
{
@@ -295,9 +285,7 @@ void QRuntimeWindowSurface::flush(QWidget *widget, const QRegion &region,
void QRuntimeWindowSurface::setGeometry(const QRect &rect)
{
- m_graphicsSystem->decreaseMemoryUsage(memoryUsage());
m_windowSurface->setGeometry(rect);
- m_graphicsSystem->increaseMemoryUsage(memoryUsage());
}
bool QRuntimeWindowSurface::scroll(const QRegion &area, int dx, int dy)
@@ -330,18 +318,9 @@ QPoint QRuntimeWindowSurface::offset(const QWidget *widget) const
return m_windowSurface->offset(widget);
}
-uint QRuntimeWindowSurface::memoryUsage() const
-{
- QPaintDevice *pdev = m_windowSurface->paintDevice();
- if (pdev && pdev->depth() != 0)
- return pdev->width() * pdev->height() * (pdev->depth()/8);
-
- return 0;
-}
-
QRuntimeGraphicsSystem::QRuntimeGraphicsSystem()
- : m_memoryUsage(0), m_windowSurfaceDestroyPolicy(DestroyImmediately),
- m_graphicsSystem(0), m_graphicsSystemChangeMemoryLimit(0)
+ : m_windowSurfaceDestroyPolicy(DestroyImmediately),
+ m_graphicsSystem(0)
{
QApplicationPrivate::graphics_system_name = QLatin1String("runtime");
QApplicationPrivate::runtime_graphics_system = true;
@@ -379,34 +358,15 @@ QWindowSurface *QRuntimeGraphicsSystem::createWindowSurface(QWidget *widget) con
rtSurface->m_windowSurface = m_graphicsSystem->createWindowSurface(widget);
widget->setWindowSurface(rtSurface);
m_windowSurfaces << rtSurface;
- increaseMemoryUsage(rtSurface->memoryUsage());
return rtSurface;
}
-/*!
- Sets graphics system when resource memory consumption is under /a memoryUsageLimit.
-*/
-void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name, uint memoryUsageLimit)
-{
-#ifdef QT_DEBUG
- qDebug() << "QRuntimeGraphicsSystem::setGraphicsSystem( "<< name <<", " << memoryUsageLimit << ")";
- qDebug() << " current approximated graphics system memory usage " << memoryUsage() << " bytes";
-#endif
- if (memoryUsage() >= memoryUsageLimit) {
- m_graphicsSystemChangeMemoryLimit = memoryUsageLimit;
- m_pendingGraphicsSystemName = name;
- } else {
- setGraphicsSystem(name);
- }
-}
-
void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name)
{
if (m_graphicsSystemName == name)
return;
#ifdef QT_DEBUG
qDebug() << "QRuntimeGraphicsSystem::setGraphicsSystem( " << name << " )";
- qDebug() << " current approximated graphics system memory usage "<< memoryUsage() << " bytes";
#endif
delete m_graphicsSystem;
m_graphicsSystem = QGraphicsSystemFactory::create(name);
@@ -414,7 +374,6 @@ void QRuntimeGraphicsSystem::setGraphicsSystem(const QString &name)
Q_ASSERT(m_graphicsSystem);
- m_graphicsSystemChangeMemoryLimit = 0;
m_pendingGraphicsSystemName = QString();
for (int i = 0; i < m_pixmapDatas.size(); ++i) {
@@ -447,42 +406,12 @@ void QRuntimeGraphicsSystem::removePixmapData(QRuntimePixmapData *pixmapData) co
{
int index = m_pixmapDatas.lastIndexOf(pixmapData);
m_pixmapDatas.removeAt(index);
- decreaseMemoryUsage(pixmapData->memoryUsage(), true);
}
void QRuntimeGraphicsSystem::removeWindowSurface(QRuntimeWindowSurface *windowSurface) const
{
int index = m_windowSurfaces.lastIndexOf(windowSurface);
m_windowSurfaces.removeAt(index);
- decreaseMemoryUsage(windowSurface->memoryUsage(), true);
-}
-
-void QRuntimeGraphicsSystem::increaseMemoryUsage(uint amount) const
-{
- m_memoryUsage += amount;
-
- if (m_graphicsSystemChangeMemoryLimit &&
- m_memoryUsage < m_graphicsSystemChangeMemoryLimit) {
-
- QRuntimeGraphicsSystem *gs = const_cast<QRuntimeGraphicsSystem*>(this);
- QDeferredGraphicsSystemChange *deferredChange =
- new QDeferredGraphicsSystemChange(gs, m_pendingGraphicsSystemName);
- deferredChange->launch();
- }
-}
-
-void QRuntimeGraphicsSystem::decreaseMemoryUsage(uint amount, bool persistent) const
-{
- m_memoryUsage -= amount;
-
- if (persistent && m_graphicsSystemChangeMemoryLimit &&
- m_memoryUsage < m_graphicsSystemChangeMemoryLimit) {
-
- QRuntimeGraphicsSystem *gs = const_cast<QRuntimeGraphicsSystem*>(this);
- QDeferredGraphicsSystemChange *deferredChange =
- new QDeferredGraphicsSystemChange(gs, m_pendingGraphicsSystemName);
- deferredChange->launch();
- }
}
#include "qgraphicssystem_runtime.moc"
diff --git a/src/gui/painting/qgraphicssystem_runtime_p.h b/src/gui/painting/qgraphicssystem_runtime_p.h
index 7aab89c..d4c9152 100644
--- a/src/gui/painting/qgraphicssystem_runtime_p.h
+++ b/src/gui/painting/qgraphicssystem_runtime_p.h
@@ -104,8 +104,6 @@ public:
virtual QPixmapData *runtimeData() const;
- virtual uint memoryUsage() const;
-
private:
const QRuntimeGraphicsSystem *m_graphicsSystem;
@@ -131,8 +129,6 @@ public:
virtual QPoint offset(const QWidget *widget) const;
- virtual uint memoryUsage() const;
-
QWindowSurface *m_windowSurface;
QWindowSurface *m_pendingWindowSurface;
@@ -159,7 +155,6 @@ public:
void removePixmapData(QRuntimePixmapData *pixmapData) const;
void removeWindowSurface(QRuntimeWindowSurface *windowSurface) const;
- void setGraphicsSystem(const QString &name, uint memoryUsageLimit);
void setGraphicsSystem(const QString &name);
QString graphicsSystemName() const { return m_graphicsSystemName; }
@@ -170,22 +165,14 @@ public:
int windowSurfaceDestroyPolicy() const { return m_windowSurfaceDestroyPolicy; }
- uint memoryUsage() const { return m_memoryUsage; }
-
-private:
-
- void increaseMemoryUsage(uint amount) const;
- void decreaseMemoryUsage(uint amount, bool persistent = false) const;
private:
- mutable uint m_memoryUsage;
int m_windowSurfaceDestroyPolicy;
QGraphicsSystem *m_graphicsSystem;
mutable QList<QRuntimePixmapData *> m_pixmapDatas;
mutable QList<QRuntimeWindowSurface *> m_windowSurfaces;
QString m_graphicsSystemName;
- uint m_graphicsSystemChangeMemoryLimit;
QString m_pendingGraphicsSystemName;
friend class QRuntimePixmapData;
diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def
index 7844688..90c0878 100644
--- a/src/s60installs/bwins/QtGuiu.def
+++ b/src/s60installs/bwins/QtGuiu.def
@@ -12832,7 +12832,7 @@ EXPORTS
?readBackInfo@QRuntimePixmapData@@QAEXXZ @ 12831 NONAME ; void QRuntimePixmapData::readBackInfo(void)
??_EQRuntimePixmapData@@UAE@I@Z @ 12832 NONAME ; QRuntimePixmapData::~QRuntimePixmapData(unsigned int)
?paintEngine@QRuntimePixmapData@@UBEPAVQPaintEngine@@XZ @ 12833 NONAME ; class QPaintEngine * QRuntimePixmapData::paintEngine(void) const
- ?memoryUsage@QRuntimePixmapData@@UBEIXZ @ 12834 NONAME ; unsigned int QRuntimePixmapData::memoryUsage(void) const
+ ?memoryUsage@QRuntimePixmapData@@UBEIXZ @ 12834 NONAME ABSENT ; unsigned int QRuntimePixmapData::memoryUsage(void) const
?toImage@QRasterPixmapData@@UBE?AVQImage@@ABVQRect@@@Z @ 12835 NONAME ; class QImage QRasterPixmapData::toImage(class QRect const &) const
?fromImageReader@QRasterPixmapData@@UAEXPAVQImageReader@@V?$QFlags@W4ImageConversionFlag@Qt@@@@@Z @ 12836 NONAME ; void QRasterPixmapData::fromImageReader(class QImageReader *, class QFlags<enum Qt::ImageConversionFlag>)
?fill@QRuntimePixmapData@@UAEXABVQColor@@@Z @ 12837 NONAME ; void QRuntimePixmapData::fill(class QColor const &)
diff --git a/src/s60installs/eabi/QtGuiu.def b/src/s60installs/eabi/QtGuiu.def
index a22b4d9..d8e86bf 100644
--- a/src/s60installs/eabi/QtGuiu.def
+++ b/src/s60installs/eabi/QtGuiu.def
@@ -12046,7 +12046,7 @@ EXPORTS
_ZN18QRuntimePixmapDataD1Ev @ 12045 NONAME
_ZN18QRuntimePixmapDataD2Ev @ 12046 NONAME
_ZN7QPixmap15fromImageReaderEP12QImageReader6QFlagsIN2Qt19ImageConversionFlagEE @ 12047 NONAME
- _ZNK18QRuntimePixmapData11memoryUsageEv @ 12048 NONAME
+ _ZNK18QRuntimePixmapData11memoryUsageEv @ 12048 NONAME ABSENT
_ZNK18QRuntimePixmapData11paintEngineEv @ 12049 NONAME
_ZNK18QRuntimePixmapData11runtimeDataEv @ 12050 NONAME
_ZNK18QRuntimePixmapData11transformedERK10QTransformN2Qt18TransformationModeE @ 12051 NONAME