From ca663a7252637f8066a0e7368650e72094220b69 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 9 Feb 2011 09:45:09 +0000 Subject: Recreate Symbian raster backing store when WA_TranslucentBackground set Task-number: QTBUG-17288 Reviewed-by: Jani Hautakangas --- src/gui/image/qpixmap_s60.cpp | 26 ++++++++++++++++++++++++++ src/gui/image/qpixmap_s60_p.h | 3 +++ src/gui/painting/qwindowsurface_s60.cpp | 17 +++++++++++++---- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index dbe8177..a7aeb84 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -1012,6 +1012,32 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType) } } +void QS60PixmapData::convertToDisplayMode(TDisplayMode mode) +{ + if (!cfbsBitmap || cfbsBitmap->DisplayMode() == mode) + return; + if (image.depth() != TDisplayModeUtils::NumDisplayModeBitsPerPixel(mode)) { + qWarning("Cannot convert display mode due to depth mismatch"); + return; + } + + const TSize size = cfbsBitmap->SizeInPixels(); + QScopedPointer newBitmap(createSymbianCFbsBitmap(size, mode)); + + const uchar *sptr = const_cast(image).bits(); + symbianBitmapDataAccess->beginDataAccess(newBitmap.data()); + uchar *dptr = (uchar*)newBitmap->DataAddress(); + Mem::Copy(dptr, sptr, image.byteCount()); + symbianBitmapDataAccess->endDataAccess(newBitmap.data()); + + QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock); + delete cfbsBitmap; + lock.relock(); + cfbsBitmap = newBitmap.take(); + setSerialNumber(cfbsBitmap->Handle()); + UPDATE_BUFFER(); +} + QPixmapData *QS60PixmapData::createCompatiblePixmapData() const { return new QS60PixmapData(pixelType()); diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h index e4060dc..c1d7941 100644 --- a/src/gui/image/qpixmap_s60_p.h +++ b/src/gui/image/qpixmap_s60_p.h @@ -54,6 +54,7 @@ // #include +#include QT_BEGIN_NAMESPACE @@ -107,6 +108,8 @@ public: void* toNativeType(NativeType type); void fromNativeType(void* pixmap, NativeType type); + void convertToDisplayMode(TDisplayMode mode); + private: void release(); void fromSymbianBitmap(CFbsBitmap* bitmap, bool lockFormat=false); diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 7dc5cb7..9f371a8 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -61,13 +61,11 @@ struct QS60WindowSurfacePrivate QList bufferImages; }; -QS60WindowSurface::QS60WindowSurface(QWidget* widget) - : QWindowSurface(widget), d_ptr(new QS60WindowSurfacePrivate) +TDisplayMode displayMode(bool opaque) { TDisplayMode mode = S60->screenDevice()->DisplayMode(); - bool isOpaque = qt_widget_private(widget)->isOpaque; - if (isOpaque) { + if (opaque) { mode = EColor16MU; } else { if (QSysInfo::symbianVersion() >= QSysInfo::SV_SF_3) @@ -75,7 +73,13 @@ QS60WindowSurface::QS60WindowSurface(QWidget* widget) else mode = EColor16MA; // Symbian prior to Symbian^3 sw accelerates EColor16MA } + return mode; +} +QS60WindowSurface::QS60WindowSurface(QWidget* widget) + : QWindowSurface(widget), d_ptr(new QS60WindowSurfacePrivate) +{ + TDisplayMode mode = displayMode(qt_widget_private(widget)->isOpaque); // We create empty CFbsBitmap here -> it will be resized in setGeometry CFbsBitmap *bitmap = q_check_ptr(new CFbsBitmap); // CBase derived object needs check on new qt_symbian_throwIfError( bitmap->Create( TSize(0, 0), mode ) ); @@ -121,6 +125,11 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn) if (!qt_widget_private(window())->isOpaque) { QS60PixmapData *pixmapData = static_cast(d_ptr->device.data_ptr().data()); + + TDisplayMode mode = displayMode(false); + if (pixmapData->cfbsBitmap->DisplayMode() != mode) + pixmapData->convertToDisplayMode(mode); + pixmapData->beginDataAccess(); QPainter p(&pixmapData->image); -- cgit v0.12 From 36f8782a5994d5ea2cd71695daf0f33b5e37e609 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 9 Feb 2011 09:50:30 +0000 Subject: Changes for 4.7.2 Reviewed-by: Jani Hautakangas --- dist/changes-4.7.2 | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dist/changes-4.7.2 b/dist/changes-4.7.2 index 0d93052..b981fd2 100644 --- a/dist/changes-4.7.2 +++ b/dist/changes-4.7.2 @@ -47,10 +47,10 @@ QtGui - QWidget * [QTMOBILITY-645] Send WinIdChange event when winId is set to zero. - The window handle of a native widget may be set to zero in two - situations: (i) temporarily, during reparenting and (ii) during - widget destruction. Previously, no WinIdChange event was sent in - either of these cases; now, it is sent in both cases. + The window handle of a native widget may be set to zero in two + situations: (i) temporarily, during reparenting and (ii) during + widget destruction. Previously, no WinIdChange event was sent in + either of these cases; now, it is sent in both cases. QtDBus ------ @@ -137,6 +137,12 @@ Qt for Symbian * [QTBUG-13857] Added systemProxyForQuery() for Symbian, allowing network proxies configured on the device to be used by applications. + - QWidget + * [QT-4416, QTBUG-17288] On devices which lack support for transparency + in EGL surfaces, setting Qt::WA_TranslucentBackground on a widget + whose windowType() is Qt::Window causes that widget to be rendered + using the raster graphics system. + Qt for Embedded Linux --------------------- -- cgit v0.12 From b52bf57e46520fb65d3d4c43bdb9c3d972690cb8 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Wed, 9 Feb 2011 14:12:42 +0200 Subject: Fix regression in creating mkspecs/default Copy all files from original mkspec to default one and modify *.conf, *.prf, and *.h to include their original counterparts. Task-number: QTBUG-17258 Reviewed-by: Oswald Buddenhagen --- tools/configure/configureapp.cpp | 30 ++++---------------- tools/configure/environment.cpp | 61 +++++++++++++++++++++++++++++++++++++--- tools/configure/environment.h | 4 ++- 3 files changed, 66 insertions(+), 29 deletions(-) diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 8fa03ab..1b77058 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3244,8 +3244,7 @@ void Configure::generateConfigfiles() } // Copy configured mkspec to default directory, but remove the old one first, if there is any - QString mkspecsPath = buildPath + "/mkspecs"; - QString defSpec = mkspecsPath + "/default"; + QString defSpec = buildPath + "/mkspecs/default"; QFileInfo defSpecInfo(defSpec); if (defSpecInfo.exists()) { if (!Environment::rmdir(defSpec)) { @@ -3255,30 +3254,13 @@ void Configure::generateConfigfiles() } } - QDir mkspecsDir(mkspecsPath); - if (!mkspecsDir.mkdir("default")) { - cout << "Couldn't create default mkspec dir!" << endl; - dictionary["DONE"] = "error"; - return; - } - QString spec = dictionary.contains("XQMAKESPEC") ? dictionary["XQMAKESPEC"] : dictionary["QMAKESPEC"]; QString pltSpec = sourcePath + "/mkspecs/" + spec; - outName = defSpec + "/qmake.conf"; - QFile qmakeConfFile(outName); - if (qmakeConfFile.open(QFile::WriteOnly | QFile::Text)) { - QTextStream qmakeConfStream; - qmakeConfStream.setDevice(&qmakeConfFile); - // While QMAKESPEC_ORIGINAL being relative or absolute doesn't matter for the - // primary use of this variable by qmake to identify the original mkspec, the - // variable is also used for few special cases where the absolute path is required. - // Conversely, the include of the original qmake.conf must be done using relative path, - // as some Qt binary deployments are done in a manner that doesn't allow for patching - // the paths at the installation time. - qmakeConfStream << "QMAKESPEC_ORIGINAL=" << pltSpec << endl << endl; - qmakeConfStream << "include(" << "../" << spec << "/qmake.conf)" << endl << endl; - qmakeConfStream.flush(); - qmakeConfFile.close(); + QString includeSpec = buildPath + "/mkspecs/" + spec; + if (!Environment::cpdir(pltSpec, defSpec, includeSpec)) { + cout << "Couldn't update default mkspec! Does " << qPrintable(pltSpec) << " exist?" << endl; + dictionary["DONE"] = "error"; + return; } // Generate the new qconfig.cpp file diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 05fd567..9d1c23a 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -407,10 +407,25 @@ int Environment::execute(QStringList arguments, const QStringList &additionalEnv return exitCode; } -bool Environment::cpdir(const QString &srcDir, const QString &destDir) +/*! + Copies the \a srcDir contents into \a destDir. + + If \a includeSrcDir is not empty, any files with 'h', 'prf', or 'conf' suffixes + will not be copied over from \a srcDir. Instead a new file will be created + in \a destDir with the same name and that file will include a file with the + same name from the \a includeSrcDir using relative path and appropriate + syntax for the file type. + + Returns true if copying was successful. +*/ +bool Environment::cpdir(const QString &srcDir, + const QString &destDir, + const QString &includeSrcDir) { QString cleanSrcName = QDir::cleanPath(srcDir); QString cleanDstName = QDir::cleanPath(destDir); + QString cleanIncludeName = QDir::cleanPath(includeSrcDir); + #ifdef CONFIGURE_DEBUG_CP_DIR qDebug() << "Attempt to cpdir " << cleanSrcName << "->" << cleanDstName; #endif @@ -421,21 +436,59 @@ bool Environment::cpdir(const QString &srcDir, const QString &destDir) bool result = true; QDir dir = QDir(cleanSrcName); + QDir destinationDir = QDir(cleanDstName); QFileInfoList allEntries = dir.entryInfoList(QDir::AllDirs | QDir::Files | QDir::NoDotAndDotDot); for (int i = 0; result && (i < allEntries.count()); ++i) { QFileInfo entry = allEntries.at(i); bool intermediate = true; if (entry.isDir()) { + QString newIncSrcDir; + if (!includeSrcDir.isEmpty()) + newIncSrcDir = QString("%1/%2").arg(cleanIncludeName).arg(entry.fileName()); + intermediate = cpdir(QString("%1/%2").arg(cleanSrcName).arg(entry.fileName()), - QString("%1/%2").arg(cleanDstName).arg(entry.fileName())); + QString("%1/%2").arg(cleanDstName).arg(entry.fileName()), + newIncSrcDir); } else { QString destFile = QString("%1/%2").arg(cleanDstName).arg(entry.fileName()); #ifdef CONFIGURE_DEBUG_CP_DIR qDebug() << "About to cp (file)" << entry.absoluteFilePath() << "->" << destFile; #endif QFile::remove(destFile); - intermediate = QFile::copy(entry.absoluteFilePath(), destFile); - SetFileAttributes((wchar_t*)destFile.utf16(), FILE_ATTRIBUTE_NORMAL); + QString suffix = entry.suffix(); + if (!includeSrcDir.isEmpty() && (suffix == "prf" || suffix == "conf" || suffix == "h")) { + QString relativeIncludeFilePath = QString("%1/%2").arg(cleanIncludeName).arg(entry.fileName()); + relativeIncludeFilePath = destinationDir.relativeFilePath(relativeIncludeFilePath); +#ifdef CONFIGURE_DEBUG_CP_DIR + qDebug() << "...instead generate relative include to" << relativeIncludeFilePath; +#endif + QFile currentFile(destFile); + if (currentFile.open(QFile::WriteOnly | QFile::Text)) { + QTextStream fileStream; + fileStream.setDevice(¤tFile); + + if (suffix == "prf" || suffix == "conf") { + if (entry.fileName() == "qmake.conf") { + // While QMAKESPEC_ORIGINAL being relative or absolute doesn't matter for the + // primary use of this variable by qmake to identify the original mkspec, the + // variable is also used for few special cases where the absolute path is required. + // Conversely, the include of the original qmake.conf must be done using relative path, + // as some Qt binary deployments are done in a manner that doesn't allow for patching + // the paths at the installation time. + fileStream << "QMAKESPEC_ORIGINAL=" << cleanSrcName << endl << endl; + } + fileStream << "include(" << relativeIncludeFilePath << ")" << endl << endl; + } else if (suffix == "h") { + fileStream << "#include \"" << relativeIncludeFilePath << "\"" << endl << endl; + } + + fileStream.flush(); + currentFile.close(); + } + } else { + intermediate = QFile::copy(entry.absoluteFilePath(), destFile); + SetFileAttributes((wchar_t*)destFile.utf16(), FILE_ATTRIBUTE_NORMAL); + } } if(!intermediate) { qDebug() << "cpdir: Failure for " << entry.fileName() << entry.isDir(); diff --git a/tools/configure/environment.h b/tools/configure/environment.h index e3e8629..61e97eb 100644 --- a/tools/configure/environment.h +++ b/tools/configure/environment.h @@ -69,7 +69,9 @@ public: static bool detectExecutable(const QString &executable); static int execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv); - static bool cpdir(const QString &srcDir, const QString &destDir); + static bool cpdir(const QString &srcDir, + const QString &destDir, + const QString &includeSrcDir = QString()); static bool rmdir(const QString &name); static QString symbianEpocRoot(); -- cgit v0.12 From bf47aa67e286f31db5a8b84060f278f7fea217b2 Mon Sep 17 00:00:00 2001 From: Gareth Stockwell Date: Wed, 9 Feb 2011 15:00:26 +0000 Subject: Fix build failure Task-number: QTBUG-17288 Reviewed-by: trustme --- src/gui/image/qpixmap_s60.cpp | 9 +++++---- src/gui/image/qpixmap_s60_p.h | 3 +-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index a7aeb84..ca5f133 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -1012,17 +1012,18 @@ void QS60PixmapData::fromNativeType(void* pixmap, NativeType nativeType) } } -void QS60PixmapData::convertToDisplayMode(TDisplayMode mode) +void QS60PixmapData::convertToDisplayMode(int mode) { - if (!cfbsBitmap || cfbsBitmap->DisplayMode() == mode) + const TDisplayMode displayMode = static_cast(mode); + if (!cfbsBitmap || cfbsBitmap->DisplayMode() == displayMode) return; - if (image.depth() != TDisplayModeUtils::NumDisplayModeBitsPerPixel(mode)) { + if (image.depth() != TDisplayModeUtils::NumDisplayModeBitsPerPixel(displayMode)) { qWarning("Cannot convert display mode due to depth mismatch"); return; } const TSize size = cfbsBitmap->SizeInPixels(); - QScopedPointer newBitmap(createSymbianCFbsBitmap(size, mode)); + QScopedPointer newBitmap(createSymbianCFbsBitmap(size, displayMode)); const uchar *sptr = const_cast(image).bits(); symbianBitmapDataAccess->beginDataAccess(newBitmap.data()); diff --git a/src/gui/image/qpixmap_s60_p.h b/src/gui/image/qpixmap_s60_p.h index c1d7941..c440bbc 100644 --- a/src/gui/image/qpixmap_s60_p.h +++ b/src/gui/image/qpixmap_s60_p.h @@ -54,7 +54,6 @@ // #include -#include QT_BEGIN_NAMESPACE @@ -108,7 +107,7 @@ public: void* toNativeType(NativeType type); void fromNativeType(void* pixmap, NativeType type); - void convertToDisplayMode(TDisplayMode mode); + void convertToDisplayMode(int mode); private: void release(); -- cgit v0.12 From 34aca9f03e25e94b4ca730ddd3c88aa95653a0b5 Mon Sep 17 00:00:00 2001 From: Iain Date: Wed, 9 Feb 2011 17:34:27 +0000 Subject: Change paging attributes for Symbian binaries Removed UNPAGED workaround from QtCore and QtSql on OS releases where data paging is supported. Depends on new macro being defined in the OS builds (SYMBIAN_DLL_DATA_EXPORTS_SUPPORTED) to allow us to detect this. Data exports are supported in all S^3 builds after early 2009, however, this macro is only added recently (and thus isn't defined in, eg. Symbian Foundation PDKs (v3.0.4), or current releases (v0.9) of the S^3 SDK from Nokia). Thus building Qt against these older S^3 builds will still result in QtCore and QtSql being unpaged. Also, remove PAGED keyword from all Qt-based software. This changes the code paging field in the Symbian (E32Image) header from "paged" to "default". Thus it is left to the configuration of the particular device whether paging is used for the binary or not. All devices that support code paging should have it turned on (the value is stored in the HAL, so can be checked using eg. fshell); data paging may or may not be turned on depending on the device characteristics. Leaving both code and data paging as "default" means that any limitations in the device (eg. around flash wear) can be controlled by that device by disabling the appropriate types of paging. This change also leaves the way open to deprecated PAGED as a keyword in the Symbian build systems, so you can only opt out of paging. This makes more sense, as the default for code paging will be on, the default for data paging will be on if the device can handle it, and binaries should only be opting out of paging if they have some specific real-time requirements that paging inhibits. Task-number: QT-3503 Task-number: QTBUG-13931 Reviewed-by: Shane Kearns --- mkspecs/common/symbian/symbian-mmp.conf | 5 +++-- src/corelib/corelib.pro | 9 ++++++--- src/sql/sql.pro | 9 ++++++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/mkspecs/common/symbian/symbian-mmp.conf b/mkspecs/common/symbian/symbian-mmp.conf index 4d554bd..8ed326a 100644 --- a/mkspecs/common/symbian/symbian-mmp.conf +++ b/mkspecs/common/symbian/symbian-mmp.conf @@ -13,7 +13,7 @@ symbian-abld { } else { MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA = "OPTION_REPLACE ARMCC --export_all_vtbl // don't use --export_all_vtbl" } -MMP_RULES += PAGED BYTEPAIRCOMPRESSTARGET +MMP_RULES += BYTEPAIRCOMPRESSTARGET MMP_RULES += $$MMP_RULES_DONT_EXPORT_ALL_CLASS_IMPEDIMENTA SYMBIAN_PLATFORMS = WINSCW GCCE ARMV5 ARMV6 @@ -28,7 +28,8 @@ INCLUDEPATH = \ # RVCT seems to do this automatically, but WINSCW compiler does not, so add it here. MMP_RULES += "USERINCLUDE ." -contains(S60_VERSION, 3.1):MMP_RULES -= PAGED BYTEPAIRCOMPRESSTARGET +# S60 3.1 devices don't support paging for non-ROM components, so no point in using the less efficient compression mechanism +contains(S60_VERSION, 3.1):MMP_RULES -= BYTEPAIRCOMPRESSTARGET QMAKE_CXXFLAGS_FAST_VFP.ARMCC = --fpmode fast # [TODO] QMAKE_CXXFLAGS_FAST_VFP.GCCE = diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index a001940..06aa191 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -33,7 +33,10 @@ contains(DEFINES,QT_EVAL):include(eval.pri) symbian: { TARGET.UID3=0x2001B2DC - # Workaroud for problems with paging this dll - MMP_RULES -= PAGED - MMP_RULES *= UNPAGED + # Problems using data exports from this DLL mean that we can't page it on releases that don't support + # data exports (currently that's any release before Symbian^3) + pagingBlock = "$${LITERAL_HASH}ifndef SYMBIAN_DLL_DATA_EXPORTS_SUPPORTED" \ + "UNPAGED" \ + "$${LITERAL_HASH}endif" + MMP_RULES += pagingBlock } diff --git a/src/sql/sql.pro b/src/sql/sql.pro index b8f819d..a02b0f4 100644 --- a/src/sql/sql.pro +++ b/src/sql/sql.pro @@ -20,7 +20,10 @@ include(models/models.pri) symbian: { TARGET.UID3=0x2001E61D - # Workaroud for problems with paging this dll - MMP_RULES -= PAGED - MMP_RULES *= UNPAGED + # Problems using data exports from this DLL mean that we can't page it on releases that don't support + # data exports (currently that's any release before Symbian^3) + pagingBlock = "$${LITERAL_HASH}ifndef SYMBIAN_DLL_DATA_EXPORTS_SUPPORTED" \ + "UNPAGED" \ + "$${LITERAL_HASH}endif" + MMP_RULES += pagingBlock } -- cgit v0.12 From 97305f4ca91b380f42ff5d3fd49c268df0c5ff8c Mon Sep 17 00:00:00 2001 From: Iain Date: Wed, 9 Feb 2011 18:16:29 +0000 Subject: 4.7.2 changes Reviewed-by: TrustMe --- dist/changes-4.7.2 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dist/changes-4.7.2 b/dist/changes-4.7.2 index b981fd2..7207d88 100644 --- a/dist/changes-4.7.2 +++ b/dist/changes-4.7.2 @@ -129,6 +129,22 @@ Qt for Mac OS X Qt for Symbian -------------- + - Paging changes + * [QT-3503] Remove PAGED keyword from all Qt-based binaries for + MMP-based build systems (abld, SBSv2 (a.k.a. Raptor)). + This changes the code paging field in the Symbian (E32Image) header + from "paged" to "default". Thus it is left to the configuration + of the particular device whether paging is used for the binary or + not. All devices that support code paging should have it turned + on (the value is stored in the HAL, so can be checked using eg. + fshell); data paging may or may not be turned on depending on the + device characteristics. Leaving both code and data paging as + "default" means that any limitations in the device (eg. around + flash wear) can be controlled by that device by disabling the + appropriate types of paging rather than being forced by the binary + (which may be deployed to several different devices with different + characteristics). + - Phonon MMF backend * [QTBUG-11436] Added a MediaObject property which allows the client to specify which Internet Access Point should be used for streaming. -- cgit v0.12