From 78a0cf9c347b80e7d7b1eb369d8ff28c49ed1b7d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 21 Apr 2010 09:29:15 +0200 Subject: QStyleSheetStyle: fix memory leak on base style change On every change of the base style it is inserted into styleSheetCache. If the base style gets destroyed, it must be removed from the cache. Task-number: QTBUG-4074 Reviewed-by: ogoffart --- src/gui/styles/qstylesheetstyle.cpp | 9 ++++++++- src/gui/styles/qstylesheetstyle_p.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 285a789..0b615bc 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -1533,7 +1533,9 @@ QVector QStyleSheetStyle::styleRules(const QWidget *w) const QHash::const_iterator defaultCacheIt = styleSheetCache->constFind(baseStyle()); if (defaultCacheIt == styleSheetCache->constEnd()) { defaultSs = getDefaultStyleSheet(); - styleSheetCache->insert(baseStyle(), defaultSs); + QStyle *bs = baseStyle(); + styleSheetCache->insert(bs, defaultSs); + QObject::connect(bs, SIGNAL(destroyed(QObject*)), this, SLOT(styleDestroyed(QObject*)), Qt::UniqueConnection); } else { defaultSs = defaultCacheIt.value(); } @@ -2660,6 +2662,11 @@ void QStyleSheetStyle::widgetDestroyed(QObject *o) autoFillDisabledWidgets->remove((const QWidget *)o); } +void QStyleSheetStyle::styleDestroyed(QObject *o) +{ + styleSheetCache->remove(o); +} + /*! * Make sure that the cache will be clean by connecting destroyed if needed. * return false if the widget is not stylable; diff --git a/src/gui/styles/qstylesheetstyle_p.h b/src/gui/styles/qstylesheetstyle_p.h index 50abef9..fd81437 100644 --- a/src/gui/styles/qstylesheetstyle_p.h +++ b/src/gui/styles/qstylesheetstyle_p.h @@ -147,6 +147,7 @@ protected: private Q_SLOTS: void widgetDestroyed(QObject *); + void styleDestroyed(QObject *); private: int refcount; -- cgit v0.12 From 1c2fcea39d5413821e655659c1dcb7cabe532bea Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 21 Apr 2010 09:38:34 +0200 Subject: examples/widgets/stylesheet fix mainwindow.ui femaleRadioButton had its tool tip in the styleSheet property. Reviewed-by: ogoffart --- examples/widgets/stylesheet/mainwindow.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/widgets/stylesheet/mainwindow.ui b/examples/widgets/stylesheet/mainwindow.ui index 2b232df..cc29257 100644 --- a/examples/widgets/stylesheet/mainwindow.ui +++ b/examples/widgets/stylesheet/mainwindow.ui @@ -196,7 +196,7 @@ - + Check this if you are female -- cgit v0.12 From 11b2a34d5a1b86883bb44bad83b9b23953b850c2 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 20 Apr 2010 11:04:15 +0200 Subject: fix compilation of tst_sharedmemory on Windows CE Reviewed-by: mauricek --- tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp index 83f65b0..d1db003 100644 --- a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp +++ b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp @@ -52,7 +52,7 @@ #ifdef Q_OS_SYMBIAN #define SRCDIR "c:/data/qsharedmemorytemp/" #define LACKEYDIR SRCDIR "lackey" -#elif Q_OS_WINCE +#elif defined(Q_OS_WINCE) #define LACKEYDIR SRCDIR "lackey" #else #define LACKEYDIR SRCDIR "../lackey" -- cgit v0.12 From 590fa9360f2c473fc175caa88d2fa4bfaf23ea0d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 20 Apr 2010 11:52:58 +0200 Subject: tst_qsharedmemory: fix deployment of lackey.exe for WinCE Reviewed-by: mauricek --- tests/auto/qtipc/qsharedmemory/test/test.pro | 6 +++--- tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/qtipc/qsharedmemory/test/test.pro b/tests/auto/qtipc/qsharedmemory/test/test.pro index 40ba8b9..4ff5486 100644 --- a/tests/auto/qtipc/qsharedmemory/test/test.pro +++ b/tests/auto/qtipc/qsharedmemory/test/test.pro @@ -20,10 +20,10 @@ TARGET = ../tst_qsharedmemory wince*:{ requires(contains(QT_CONFIG,script)) QT += gui script -addFiles.sources = ../../lackey/lackey.exe ../../lackey/scripts -addFiles.path = lackey +addFiles.sources = $$OUT_PWD/../../lackey/lackey.exe ../../lackey/scripts +addFiles.path = . DEPLOYMENT += addFiles -DEFINES += SRCDIR=\\\"\\\" +DEFINES += SRCDIR=\\\".\\\" }else:symbian*{ requires(contains(QT_CONFIG,script)) QT += gui script diff --git a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp index d1db003..ebae328 100644 --- a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp +++ b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp @@ -53,7 +53,7 @@ #define SRCDIR "c:/data/qsharedmemorytemp/" #define LACKEYDIR SRCDIR "lackey" #elif defined(Q_OS_WINCE) -#define LACKEYDIR SRCDIR "lackey" +#define LACKEYDIR SRCDIR #else #define LACKEYDIR SRCDIR "../lackey" #endif -- cgit v0.12 From 3e4f9cf4d0d5f6cd66aa6612d0541213278ec060 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 20 Apr 2010 11:53:46 +0200 Subject: tst_qsharedmemory: create multiple instances of lackey.exe on WinCE We can't start multiple instances of an executable on Windows CE. To work around, this test now creates several copies of lackey.exe Reviewed-by: mauricek --- tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp index ebae328..dac631b 100644 --- a/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp +++ b/tests/auto/qtipc/qsharedmemory/tst_qsharedmemory.cpp @@ -42,6 +42,7 @@ #include #include +#include //TESTED_CLASS= //TESTED_FILES= @@ -746,7 +747,18 @@ void tst_QSharedMemory::simpleProcessProducerConsumer() QStringList arguments = QStringList() << LACKEYDIR "/scripts/consumer.js"; QProcess *p = new QProcess; p->setProcessChannelMode(QProcess::ForwardedChannels); +#ifdef Q_OS_WINCE + // We can't start the same executable twice on Windows CE. + // Create a copy instead. + QString lackeyCopy = QLatin1String(LACKEYDIR "/lackey"); + lackeyCopy.append(QString::number(i)); + lackeyCopy.append(QLatin1String(".exe")); + if (!QFile::exists(lackeyCopy)) + QVERIFY(QFile::copy(LACKEYDIR "/lackey.exe", lackeyCopy)); + p->start(lackeyCopy, arguments); +#else p->start(LACKEYDIR "/lackey", arguments); +#endif if (p->waitForStarted(2000)) consumers.append(p); -- cgit v0.12 From f994399839ce7ef4f22b2c88154dd93d3dcf3673 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 20 Apr 2010 13:06:53 +0200 Subject: tst_qsystemsemaphore: fix deployment of lackey.exe for WinCE Bonus: typo fixed. Reviewed-by: mauricek --- .../qtipc/qsystemsemaphore/qsystemsemaphore.pro | 5 ++--- .../qsystemsemaphore/tst_qsystemsemaphore.cpp | 24 +++++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro index 1f9205e..8a5f8b2 100644 --- a/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro +++ b/tests/auto/qtipc/qsystemsemaphore/qsystemsemaphore.pro @@ -17,9 +17,8 @@ requires(contains(QT_CONFIG,script)) # this test calls lackey, which then again depends on QtScript. # let's add it here so that it gets deployed easily QT += script -lackey.sources = ../lackey/lackey.exe -lackey.path = ../lackey - +lackey.sources = $$OUT_PWD/../lackey/lackey.exe ../lackey/scripts +lackey.path = . DEPLOYMENT += lackey } diff --git a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp index eb82fd4..d8f318f 100644 --- a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp +++ b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp @@ -46,7 +46,11 @@ //TESTED_FILES= #define EXISTING_SHARE "existing" -#define LACKYLOC "../lackey" +#ifdef Q_OS_WINCE +#define LACKEYLOC "." +#else +#define LACKEYLOC "../lackey" +#endif #define LACKYWAITTIME 10000 class tst_QSystemSemaphore : public QObject @@ -109,7 +113,7 @@ private: tst_QSystemSemaphore::tst_QSystemSemaphore() { - if (!QFile::exists(LACKYLOC "/lackey")) + if (!QFile::exists(LACKEYLOC "/lackey")) qWarning() << "lackey executable doesn't exists!"; } @@ -197,11 +201,11 @@ void tst_QSystemSemaphore::basicProcesses() QProcess release; release.setProcessChannelMode(QProcess::ForwardedChannels); - acquire.start(LACKYLOC "/lackey", acquireArguments); + acquire.start(LACKEYLOC "/lackey", acquireArguments); acquire.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state() == QProcess::Running); acquire.kill(); - release.start(LACKYLOC "/lackey", releaseArguments); + release.start(LACKEYLOC "/lackey", releaseArguments); acquire.waitForFinished(LACKYWAITTIME); release.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state() == QProcess::NotRunning); @@ -235,7 +239,7 @@ void tst_QSystemSemaphore::processes() QProcess *p = new QProcess; p->setProcessChannelMode(QProcess::ForwardedChannels); consumers.append(p); - p->start(LACKYLOC "/lackey", arguments); + p->start(LACKEYLOC "/lackey", arguments); } while (!consumers.isEmpty()) { @@ -257,13 +261,13 @@ void tst_QSystemSemaphore::undo() QStringList acquireArguments = QStringList() << acquire_js(); QProcess acquire; acquire.setProcessChannelMode(QProcess::ForwardedChannels); - acquire.start(LACKYLOC "/lackey", acquireArguments); + acquire.start(LACKEYLOC "/lackey", acquireArguments); acquire.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); // At process exit the kernel should auto undo - acquire.start(LACKYLOC "/lackey", acquireArguments); + acquire.start(LACKEYLOC "/lackey", acquireArguments); acquire.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); } @@ -283,16 +287,16 @@ void tst_QSystemSemaphore::initialValue() QProcess release; release.setProcessChannelMode(QProcess::ForwardedChannels); - acquire.start(LACKYLOC "/lackey", acquireArguments); + acquire.start(LACKEYLOC "/lackey", acquireArguments); acquire.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); - acquire.start(LACKYLOC "/lackey", acquireArguments << "2"); + acquire.start(LACKEYLOC "/lackey", acquireArguments << "2"); acquire.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state()== QProcess::Running); acquire.kill(); - release.start(LACKYLOC "/lackey", releaseArguments); + release.start(LACKEYLOC "/lackey", releaseArguments); acquire.waitForFinished(LACKYWAITTIME); release.waitForFinished(LACKYWAITTIME); QVERIFY(acquire.state()== QProcess::NotRunning); -- cgit v0.12 From 27a2684da0a76b98356f845c55b654e0b074419d Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 20 Apr 2010 13:22:42 +0200 Subject: tst_QSystemSemaphore::processes fixed for WinCE We can't start the same executable twice on Windows CE. This tests creates copies of lackey.exe now. Reviewed-by: mauricek --- tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp index d8f318f..cb3bb6b 100644 --- a/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp +++ b/tests/auto/qtipc/qsystemsemaphore/tst_qsystemsemaphore.cpp @@ -239,7 +239,20 @@ void tst_QSystemSemaphore::processes() QProcess *p = new QProcess; p->setProcessChannelMode(QProcess::ForwardedChannels); consumers.append(p); +#ifdef Q_OS_WINCE + // We can't start the same executable twice on Windows CE. + // Create a copy instead. + QString lackeyCopy = QLatin1String(LACKEYLOC "/lackey"); + if (i > 0) { + lackeyCopy.append(QString::number(i)); + lackeyCopy.append(QLatin1String(".exe")); + if (!QFile::exists(lackeyCopy)) + QVERIFY(QFile::copy(LACKEYLOC "/lackey.exe", lackeyCopy)); + } + p->start(lackeyCopy, arguments); +#else p->start(LACKEYLOC "/lackey", arguments); +#endif } while (!consumers.isEmpty()) { -- cgit v0.12 From 9542c54a295d6151c467f106c43c3c15ff4653cd Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 21 Apr 2010 12:27:04 +0200 Subject: Fix mirrored characters for RTL text in Symbian For RTL text rendering (Arabic, Hebrew), we need certain characters to be mirrored, such as brackets. This patch fixes QFontEngineS60::stringToCMap to use QChar::mirroredChar for RTL text. Task-number: QT-3299 Reviewed-by: lars --- src/gui/text/qfontengine_s60.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index c9ff661..1a99c93 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -221,9 +221,11 @@ bool QFontEngineS60::stringToCMap(const QChar *characters, int len, QGlyphLayout HB_Glyph *g = glyphs->glyphs; const unsigned char* cmap = m_extensions->cmap(); + const bool isRtl = (flags & QTextEngine::RightToLeft); for (int i = 0; i < len; ++i) { const unsigned int uc = getChar(characters, i, len); - *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, uc); + *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, + isRtl ? QChar::mirroredChar(uc) : uc); } glyphs->numGlyphs = g - glyphs->glyphs; -- cgit v0.12 From a9cd54ebf66aa51ae56a1b1a7a75423bef59605c Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 21 Apr 2010 12:43:23 +0200 Subject: Removed inneccessary QGlyphLayout::offsets initialization. Reviewed-by: lars --- src/gui/text/qfontengine_s60.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp index 1a99c93..e557f56 100644 --- a/src/gui/text/qfontengine_s60.cpp +++ b/src/gui/text/qfontengine_s60.cpp @@ -243,8 +243,8 @@ void QFontEngineS60::recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFla Q_UNUSED(flags); for (int i = 0; i < glyphs->numGlyphs; i++) { const glyph_metrics_t bbox = boundingBox_const(glyphs->glyphs[i]); - glyphs->advances_x[i] = glyphs->offsets[i].x = bbox.xoff; - glyphs->advances_y[i] = glyphs->offsets[i].y = bbox.yoff; + glyphs->advances_x[i] = bbox.xoff; + glyphs->advances_y[i] = bbox.yoff; } } -- cgit v0.12 From bff73e4c96fa4bf07534bd142302af08fa193bfa Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 21 Apr 2010 14:25:49 +0200 Subject: correctly position glyphs for complex languages Correctly use the positions calculated by getGlyphPositions to draw the glyphs. Simplify the logic a bit so that we don't need the glyphTransform anymore, but can instead just use the pathTransform for text drawing as well. Tested with latin, arabic, hebrew and Hindi text Task-number: QT-3300 Reviewed-by: Jason Barron --- src/openvg/qpaintengine_vg.cpp | 54 +++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 7445fd7..cabb41c 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -183,7 +183,6 @@ public: qreal penScale; // Pen scaling factor from "transform". QTransform pathTransform; // Calculated VG path transformation. - QTransform glyphTransform; // Calculated VG glyph transformation. QTransform imageTransform; // Calculated VG image transformation. bool pathTransformSet; // True if path transform set in the VG context. @@ -508,24 +507,15 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) // | 1 0 0 | // | 0 -1 devh | // | 0 0 1 | - // The glyph transform uses a slightly different transformation: - // | 1 0 0 | | 1 0 0.5 | | 1 0 0.5 | - // | 0 -1 devh - 1 | * | 0 1 -0.5 | = | 0 -1 (devh - 0.5) | - // | 0 0 1 | | 0 0 1 | | 0 0 1 | // The full VG transform is effectively: // 1. Apply the user's transformation matrix. - // 2. Translate glyphs by an extra (0.5, -0.5). - // 3. Flip the co-ordinate system upside down. + // 2. Flip the co-ordinate system upside down. QTransform viewport(1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, devh, 1.0f); - QTransform gviewport(1.0f, 0.0f, 0.0f, - 0.0f, -1.0f, 0.0f, - 0.5f, devh - 0.5f, 1.0f); // Compute the path transform and determine if it is projective. pathTransform = transform * viewport; - glyphTransform = transform * gviewport; bool projective = (pathTransform.m13() != 0.0f || pathTransform.m23() != 0.0f || pathTransform.m33() != 1.0f); @@ -534,7 +524,6 @@ void QVGPaintEnginePrivate::updateTransform(QPaintDevice *pdev) // so we will have to convert the co-ordinates ourselves. // Change the matrix to just the viewport transformation. pathTransform = viewport; - glyphTransform = gviewport; simpleTransform = false; } else { simpleTransform = true; @@ -3248,10 +3237,10 @@ void QVGFontGlyphCache::cacheGlyphs vgImageSubData(vgImage, qt_vg_imageBits(img), img.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, img.width(), img.height()); } } - origin[0] = -metrics.x.toReal() + 0.5f; - origin[1] = -metrics.y.toReal() + 0.5f; - escapement[0] = metrics.xoff.toReal(); - escapement[1] = metrics.yoff.toReal(); + origin[0] = -metrics.x.toReal(); + origin[1] = -metrics.y.toReal(); + escapement[0] = 0; + escapement[1] = 0; vgSetGlyphToImage(font, glyph, vgImage, origin, escapement); vgDestroyImage(vgImage); // Reduce reference count. #else @@ -3267,8 +3256,8 @@ void QVGFontGlyphCache::cacheGlyphs } origin[0] = 0; origin[1] = 0; - escapement[0] = metrics.xoff.toReal(); - escapement[1] = metrics.yoff.toReal(); + escapement[0] = 0; + escapement[1] = 0; vgSetGlyphToPath(font, glyph, vgPath, VG_FALSE, origin, escapement); vgDestroyPath(vgPath); // Reduce reference count. #endif // !defined(QVG_NO_IMAGE_GLYPHS) @@ -3293,10 +3282,8 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) // Get the glyphs and positions associated with the text item. QVarLengthArray positions; QVarLengthArray glyphs; - QTransform matrix = d->transform; - matrix.translate(p.x(), p.y()); - ti.fontEngine->getGlyphPositions - (ti.glyphs, matrix, ti.flags, glyphs, positions); + QTransform matrix; + ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions); // Find the glyph cache for this font. QVGFontCache::ConstIterator it = d->fontCache.constFind(ti.fontEngine); @@ -3320,7 +3307,7 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) } // Set the transformation to use for drawing the current glyphs. - QTransform glyphTransform(d->glyphTransform); + QTransform glyphTransform(d->pathTransform); glyphTransform.translate(p.x(), p.y()); #if defined(QVG_NO_IMAGE_GLYPHS) glyphTransform.scale(glyphCache->scaleX, glyphCache->scaleY); @@ -3330,10 +3317,18 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) // Add the glyphs from the text item into the glyph cache. glyphCache->cacheGlyphs(d, ti, glyphs); + // Create the array of adjustments between glyphs + QVarLengthArray adjustments_x(glyphs.size()); + QVarLengthArray adjustments_y(glyphs.size()); + for (int i = 1; i < glyphs.size(); ++i) { + adjustments_x[i-1] = (positions[i].x - positions[i-1].x).toReal(); + adjustments_y[i-1] = (positions[i].y - positions[i-1].y).toReal(); + } + // Set the glyph drawing origin. VGfloat origin[2]; - origin[0] = 0; - origin[1] = 0; + origin[0] = positions[0].x.toReal(); + origin[1] = positions[0].y.toReal(); vgSetfv(VG_GLYPH_ORIGIN, 2, origin); // Fast anti-aliasing for paths, better for images. @@ -3347,13 +3342,8 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) // Draw the glyphs. We need to fill with the brush associated with // the Qt pen, not the Qt brush. d->ensureBrush(state()->pen.brush()); - if (ti.renderFlags() & QTextItem::RightToLeft) { - for (int index = glyphs.size() - 1; index >= 0; --index) - vgDrawGlyph(glyphCache->font, glyphs[index], VG_FILL_PATH, VG_TRUE); - } else { - vgDrawGlyphs(glyphCache->font, glyphs.size(), (VGuint*)glyphs.data(), - NULL, NULL, VG_FILL_PATH, VG_TRUE); - } + vgDrawGlyphs(glyphCache->font, glyphs.size(), (VGuint*)glyphs.data(), + adjustments_x.data(), adjustments_y.data(), VG_FILL_PATH, VG_TRUE); #else // OpenGL 1.0 does not have support for VGFont and glyphs, // so fall back to the default Qt path stroking algorithm. -- cgit v0.12 From 25783c98686f006eebea6f358eadcbbbc49e365e Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Thu, 8 Apr 2010 15:53:37 +0200 Subject: When on Symbian use smaller files. Task-number: QT-9417 Reviewed-by: TrustMe --- .../network/access/qfile_vs_qnetworkaccessmanager/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp index 26308e9..81f6f25 100644 --- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp +++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp @@ -46,7 +46,6 @@ #include #include #include -#include "../../../../auto/network-settings.h" class qfile_vs_qnetworkaccessmanager : public QObject { @@ -78,11 +77,15 @@ void qfile_vs_qnetworkaccessmanager::initTestCase() { testFile.open(); QByteArray qba(1*1024*1024, 'x'); // 1 MB +#ifdef Q_OS_SYMBIAN + for (int i = 0; i < 10; i++) { // for Symbian only 10 MB +#else for (int i = 0; i < 100; i++) { +#endif testFile.write(qba); testFile.flush(); size += qba.size(); - } // 100 MB + } // 100 MB or 10 MB testFile.reset(); } @@ -105,7 +108,7 @@ void qfile_vs_qnetworkaccessmanager::qnamFileRead() { QNetworkAccessManager manager; QTime t; - QNetworkRequest request(QUrl(testFile.fileName())); + QNetworkRequest request(QUrl::fromLocalFile(testFile.fileName())); // do 3 dry runs for cache warmup qnamFileRead_iteration(manager, request); -- cgit v0.12 From 0497c8925677e8b7fc4120bfe90ae16653db34d3 Mon Sep 17 00:00:00 2001 From: Aleksandar Sasha Babic Date: Wed, 21 Apr 2010 17:13:31 +0200 Subject: Fixing the wrong QUrl usage As we want to use local file then QUrl::fromLocalFile is safest method. Task-number: QTBUG-9417 Reviewed-by: TrustMe --- tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp index 81f6f25..7534e09 100644 --- a/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp +++ b/tests/benchmarks/network/access/qfile_vs_qnetworkaccessmanager/main.cpp @@ -141,7 +141,7 @@ void qfile_vs_qnetworkaccessmanager::qnamImmediateFileRead() { QNetworkAccessManager manager; QTime t; - QNetworkRequest request(QUrl(testFile.fileName())); + QNetworkRequest request(QUrl::fromLocalFile(testFile.fileName())); // do 3 dry runs for cache warmup qnamImmediateFileRead_iteration(manager, request); -- cgit v0.12