From a40e77495612db0b89730debbacc585a22d0eb3a Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 16 Nov 2010 13:27:57 +0100 Subject: Fix possible missing glyphs in text when using GL engine If you create/destroy gl contexts a lot, you may sometimes get a new context with the same pointer as a destroyed context. When you look up the glyph cache in the font engine using the context pointer as a key, you will then get a glyph cache which contains no valid data. We need to reset the glyph cache completely in this case and set up bindings for the new context so that the glyph cache can be repopulated and reused. Note that there is a different solution for this in Qt 4.8, so this is temporary solution for the Qt 4.7.x series. Task-number: QT-4162 Reviewed-by: Fabien Freling --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 ++ src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 9 ++++++++- src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h | 15 ++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 1dcb773..73915cb 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1479,6 +1479,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp if (!cache || cache->cacheType() != glyphType) { cache = new QGLTextureGlyphCache(ctx, glyphType, QTransform()); staticTextItem->fontEngine()->setGlyphCache(ctx, cache); + } else if (cache->context() == 0) { // Old context has been destroyed, new context has same ptr value + cache->setContext(ctx); } bool recreateVertexArrays = false; diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 919c542..28e8c40 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -54,11 +54,18 @@ extern Q_GUI_EXPORT bool qt_cleartype_enabled; QGLTextureGlyphCache::QGLTextureGlyphCache(QGLContext *context, QFontEngineGlyphCache::Type type, const QTransform &matrix) : QImageTextureGlyphCache(type, matrix) - , ctx(context) + , ctx(0) , m_width(0) , m_height(0) , m_filterMode(Nearest) { + setContext(context); +} + +void QGLTextureGlyphCache::setContext(QGLContext *context) +{ + ctx = context; + // broken FBO readback is a bug in the SGX 1.3 and 1.4 drivers for the N900 where // copying between FBO's is broken if the texture is either GL_ALPHA or POT. The // workaround is to use a system-memory copy of the glyph cache for this device. diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h index e22146d..fa2b091 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h @@ -90,6 +90,9 @@ public: FilterMode filterMode() const { return m_filterMode; } void setFilterMode(FilterMode m) { m_filterMode = m; } + void setContext(QGLContext *context); + QGLContext *context() const { return ctx; } + public Q_SLOTS: void contextDestroyed(const QGLContext *context) { if (context == ctx) { @@ -98,10 +101,20 @@ public Q_SLOTS: // the context may not be current, so we cannot directly // destroy the fbo and texture here, but since the context // is about to be destroyed, the GL server will do the - // clean up for us anyway + // clean up for us anyway. We reset everything, so that the + // glyph cache object can be reused later by setting a new + // context on it. m_fbo = 0; m_texture = 0; ctx = 0; + m_width = 0; + m_height = 0; + m_w = 0; + m_h = 0; + m_cx = 0; + m_cy = 0; + m_currentRowHeight = 0; + coords.clear(); } else { // since the context holding the texture is shared, and // about to be destroyed, we have to transfer ownership -- cgit v0.12 From e963a1365d495649a1c8930f4776c78781218881 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Tue, 16 Nov 2010 21:47:14 +0100 Subject: Doc: Fixing typo --- src/gui/graphicsview/qgraphicstransform.cpp | 2 +- src/gui/kernel/qapplication_win.cpp | 4 ++-- src/gui/kernel/qclipboard_mac.cpp | 2 +- src/gui/kernel/qevent.cpp | 2 +- src/gui/kernel/qgesturemanager.cpp | 2 +- src/gui/kernel/qgesturemanager_p.h | 2 +- src/gui/kernel/qguiplatformplugin.cpp | 2 +- src/gui/kernel/qkeymapper_mac.cpp | 2 +- src/gui/kernel/qkeysequence.cpp | 2 +- src/gui/kernel/qwidget.cpp | 4 ++-- src/gui/kernel/qwidget_s60.cpp | 2 +- src/gui/kernel/qx11embed_x11.cpp | 2 +- src/gui/util/qundostack.cpp | 2 +- src/network/ssl/qsslsocket_openssl.cpp | 2 +- src/plugins/bearer/symbian/symbianengine.cpp | 2 +- src/plugins/graphicssystems/meego/qmeegographicssystem.cpp | 2 +- src/script/api/qscriptcontextinfo.cpp | 2 +- src/xmlpatterns/expr/qarithmeticexpression_p.h | 2 +- tests/auto/collections/tst_collections.cpp | 2 +- tools/assistant/tools/assistant/helpenginewrapper.cpp | 2 +- 20 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/gui/graphicsview/qgraphicstransform.cpp b/src/gui/graphicsview/qgraphicstransform.cpp index 1f155c6..d495da2 100644 --- a/src/gui/graphicsview/qgraphicstransform.cpp +++ b/src/gui/graphicsview/qgraphicstransform.cpp @@ -54,7 +54,7 @@ instances to one QGraphicsItem. Each QGraphicsTransform is applied in order, one at a time, to the QGraphicsItem it's assigned to. - QGraphicsTransform is particularily useful for animations. Whereas + QGraphicsTransform is particularly useful for animations. Whereas QGraphicsItem::setTransform() lets you assign any transform directly to an item, there is no direct way to interpolate between two different transformations (e.g., when transitioning between two states, each for diff --git a/src/gui/kernel/qapplication_win.cpp b/src/gui/kernel/qapplication_win.cpp index 78028eb..10c4ed6 100644 --- a/src/gui/kernel/qapplication_win.cpp +++ b/src/gui/kernel/qapplication_win.cpp @@ -3269,7 +3269,7 @@ bool QETWidget::translateMouseEvent(const MSG &msg) if (type == QEvent::MouseButtonPress && QApplication::activePopupWidget() != activePopupWidget && replayPopupMouseEvent) { - // the popup dissappeared. Replay the event + // the popup disappeared. Replay the event QWidget* w = QApplication::widgetAt(gpos.x, gpos.y); if (w && !QApplicationPrivate::isBlockedByModal(w)) { Q_ASSERT(w->testAttribute(Qt::WA_WState_Created)); @@ -3506,7 +3506,7 @@ static void tabletInit(const quint64 uniqueId, const UINT csr_type, HCTX hTab) } #endif // QT_NO_TABLETEVENT -// Update the "dynamic" informations of a cursor device (pen, airbrush, etc). +// Update the "dynamic" information of a cursor device (pen, airbrush, etc). // The dynamic information is the information of QTabletDeviceData that can change // in time (eraser or pen if a device is turned around). #ifndef QT_NO_TABLETEVENT diff --git a/src/gui/kernel/qclipboard_mac.cpp b/src/gui/kernel/qclipboard_mac.cpp index 49a6cc8..482a3a3 100644 --- a/src/gui/kernel/qclipboard_mac.cpp +++ b/src/gui/kernel/qclipboard_mac.cpp @@ -623,7 +623,7 @@ QMacPasteboard::sync() const #ifdef DEBUG_PASTEBOARD if(fromGlobal) - qDebug("Pasteboard: Syncronize!"); + qDebug("Pasteboard: Synchronize!"); #endif return fromGlobal; } diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index eade02e..7fdb926 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -1970,7 +1970,7 @@ void QInputMethodEvent::setCommitString(const QString &commitString, int replace is usually given by a wheel on 4D mouse. If the device does not support a Z-axis, pass zero here. - The \a tangentialPressure paramater contins the tangential pressure of an air + The \a tangentialPressure parameter contins the tangential pressure of an air brush. If the device does not support tangential pressure, pass 0 here. \a rotation contains the device's rotation in degrees. 4D mice support diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 9519447..46450b1 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -189,7 +189,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ QGesture *QGestureManager::getState(QObject *object, QGestureRecognizer *recognizer, Qt::GestureType type) { // if the widget is being deleted we should be careful not to - // create a new state, as it will create QWeakPointer which doesnt work + // create a new state, as it will create QWeakPointer which doesn't work // from the destructor. if (object->isWidgetType()) { if (static_cast(object)->d_func()->data.in_destructor) diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h index a5a3482..92310f5 100644 --- a/src/gui/kernel/qgesturemanager_p.h +++ b/src/gui/kernel/qgesturemanager_p.h @@ -101,7 +101,7 @@ private: NotGesture, MaybeGesture // this means timers are up and waiting for some // more events, and input events are handled by - // gesture recognizer explicitely + // gesture recognizer explicitly } state; struct ObjectGesture diff --git a/src/gui/kernel/qguiplatformplugin.cpp b/src/gui/kernel/qguiplatformplugin.cpp index 2dd251b..c80c6d3 100644 --- a/src/gui/kernel/qguiplatformplugin.cpp +++ b/src/gui/kernel/qguiplatformplugin.cpp @@ -187,7 +187,7 @@ QString QGuiPlatformPlugin::styleName() #endif } -/* return an aditional default palette (only work on X11) */ +/* return an additional default palette (only work on X11) */ QPalette QGuiPlatformPlugin::palette() { #ifdef Q_WS_X11 diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp index 300e5ca..b8f08bf 100644 --- a/src/gui/kernel/qkeymapper_mac.cpp +++ b/src/gui/kernel/qkeymapper_mac.cpp @@ -765,7 +765,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e &handled_event) == false) return handled_event; QString text(ourChar); - /* This is actually wrong - but unfortunatly it is the best that can be + /* This is actually wrong - but unfortunately it is the best that can be done for now because of the Control/Meta mapping problems */ if (modifiers & (Qt::ControlModifier | Qt::MetaModifier) && !qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 50b2354..bf3eddd 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1105,7 +1105,7 @@ QKeySequence QKeySequence::mnemonic(const QString &text) #else found = true; } else { - qWarning("QKeySequence::mnemonic: \"%s\" contains multiple occurences of '&'", qPrintable(text)); + qWarning("QKeySequence::mnemonic: \"%s\" contains multiple occurrences of '&'", qPrintable(text)); #endif } } diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index e22ec55..39c734e 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -8836,7 +8836,7 @@ void QWidget::mousePressEvent(QMouseEvent *event) QWidget* w; while ((w = QApplication::activePopupWidget()) && w != this){ w->close(); - if (QApplication::activePopupWidget() == w) // widget does not want to dissappear + if (QApplication::activePopupWidget() == w) // widget does not want to disappear w->hide(); // hide at least } if (!rect().contains(event->pos())){ @@ -9305,7 +9305,7 @@ void QWidget::setInputMethodHints(Qt::InputMethodHints hints) #ifndef QT_NO_IM Q_D(QWidget); d->imHints = hints; - // Optimisation to update input context only it has already been created. + // Optimization to update input context only it has already been created. if (d->ic || qApp->d_func()->inputContext) { QInputContext *ic = inputContext(); if (ic) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index cf4bdf1..97917ba 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -57,7 +57,7 @@ #include #endif -// This is necessary in order to be able to perform delayed invokation on slots +// This is necessary in order to be able to perform delayed invocation on slots // which take arguments of type WId. One example is // QWidgetPrivate::_q_delayedDestroy, which is used to delay destruction of // CCoeControl objects until after the CONE event handler has finished running. diff --git a/src/gui/kernel/qx11embed_x11.cpp b/src/gui/kernel/qx11embed_x11.cpp index 9f1b1f8..e6e3bfb 100644 --- a/src/gui/kernel/qx11embed_x11.cpp +++ b/src/gui/kernel/qx11embed_x11.cpp @@ -1136,7 +1136,7 @@ void QX11EmbedContainer::paintEvent(QPaintEvent *) /*! \internal - Returns wether or not the windows' embedded flag is set. + Returns whether or not the windows' embedded flag is set. */ bool QX11EmbedContainerPrivate::isEmbedded() const { diff --git a/src/gui/util/qundostack.cpp b/src/gui/util/qundostack.cpp index 919ac3c..04cfca9 100644 --- a/src/gui/util/qundostack.cpp +++ b/src/gui/util/qundostack.cpp @@ -441,7 +441,7 @@ bool QUndoStackPrivate::checkUndoLimit() /*! Constructs an empty undo stack with the parent \a parent. The - stack will initally be in the clean state. If \a parent is a + stack will initially be in the clean state. If \a parent is a QUndoGroup object, the stack is automatically added to the group. \sa push() diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index 70ef7ba..0479d83 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -728,7 +728,7 @@ void CSymbianCertificateRetriever::RunL() if (iStatus.Int() == KErrNone) iCertificates->append(iCertificateData); else - qWarning() << "CSymbianCertificateRetriever: failed to retreive a certificate, error " << iStatus.Int(); + qWarning() << "CSymbianCertificateRetriever: failed to retrieve a certificate, error " << iStatus.Int(); GetCertificateL(); break; } diff --git a/src/plugins/bearer/symbian/symbianengine.cpp b/src/plugins/bearer/symbian/symbianengine.cpp index 33fa508..f025d86 100644 --- a/src/plugins/bearer/symbian/symbianengine.cpp +++ b/src/plugins/bearer/symbian/symbianengine.cpp @@ -981,7 +981,7 @@ void SymbianEngine::RunL() QMutexLocker locker(&mutex); if (iStatus != KErrCancel) { - // By default, start relistening notifications. Stop only if interesting event occured. + // By default, start relistening notifications. Stop only if interesting event occurred. iWaitingCommsDatabaseNotifications = true; RDbNotifier::TEvent event = STATIC_CAST(RDbNotifier::TEvent, iStatus.Int()); switch (event) { diff --git a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp index 063af13..507f70b 100644 --- a/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp +++ b/src/plugins/graphicssystems/meego/qmeegographicssystem.cpp @@ -83,7 +83,7 @@ QWindowSurface* QMeeGoGraphicsSystem::createWindowSurface(QWidget *widget) const QPixmapData *QMeeGoGraphicsSystem::createPixmapData(QPixmapData::PixelType type) const { // Long story short: without this it's possible to hit an - // unitialized paintDevice due to a Qt bug too complex to even + // uninitialized paintDevice due to a Qt bug too complex to even // explain here... not to mention fix without going crazy. // MDK QGLShareContextScope ctx(qt_gl_share_widget()->context()); diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index a90e014..8528dec 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -177,7 +177,7 @@ QScriptContextInfoPrivate::QScriptContextInfoPrivate(const QScriptContext *conte fileName = source->url(); } - // Get the others informations: + // Get the others information: JSC::JSObject *callee = frame->callee(); if (callee && callee->inherits(&JSC::InternalFunction::info)) functionName = JSC::asInternalFunction(callee)->name(frame); diff --git a/src/xmlpatterns/expr/qarithmeticexpression_p.h b/src/xmlpatterns/expr/qarithmeticexpression_p.h index 66c1f13..6ff8219 100644 --- a/src/xmlpatterns/expr/qarithmeticexpression_p.h +++ b/src/xmlpatterns/expr/qarithmeticexpression_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE namespace QPatternist { /** - * @short Implements arithmetics, such as multiplication and substraction. + * @short Implements arithmetics, such as multiplication and subtraction. * * * Optimizations: there's some operator/value combos that are no ops. For diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index f81535e..43e1a52 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -1222,7 +1222,7 @@ void tst_Collections::vector() } } - // this used to trigger an unitialized read in valgrind + // this used to trigger an uninitialized read in valgrind QVector foo; foo.resize(144); diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp index a53a9ee..748ad2c 100644 --- a/tools/assistant/tools/assistant/helpenginewrapper.cpp +++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp @@ -144,7 +144,7 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile) /* * Otherwise we will waste time if several new docs are found, - * because we will start to index them, only to be interupted + * because we will start to index them, only to be interrupted * by the next request. Also, there is a nasty SQLITE bug that will * cause the application to hang for minutes in that case. * This call is reverted by initalDocSetupDone(), which must be -- cgit v0.12 From b2a89cf4049e425553bfe74bcb1a52433e6a13c7 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Wed, 17 Nov 2010 10:55:08 +0100 Subject: Send QMeeGoSwitchEvent to toplevel widgets before switching graphics system. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 926 Reviewed-by: Samuel Rødal --- .../qmeegographicssystemhelper.cpp | 17 ++++++ .../qmeegographicssystemhelper.pro | 4 +- .../qmeegoswitchevent.cpp | 58 +++++++++++++++++++ .../qmeegographicssystemhelper/qmeegoswitchevent.h | 65 ++++++++++++++++++++++ 4 files changed, 142 insertions(+), 2 deletions(-) create mode 100644 tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp create mode 100644 tools/qmeegographicssystemhelper/qmeegoswitchevent.h diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp index d348e70..b660eb3 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.cpp @@ -46,6 +46,7 @@ #include #include #include "qmeegoruntime.h" +#include "qmeegoswitchevent.h" QString QMeeGoGraphicsSystemHelper::runningGraphicsSystemName() { @@ -81,8 +82,16 @@ void QMeeGoGraphicsSystemHelper::switchToMeeGo() if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime")) qWarning("Can't switch to meego - switching only supported with 'runtime' graphics system."); else { + QMeeGoSwitchEvent willSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::WillSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &willSwitchEvent); + QApplication *app = static_cast(QCoreApplication::instance()); app->setGraphicsSystem(QLatin1String("meego")); + + QMeeGoSwitchEvent didSwitchEvent(QLatin1String("meego"), QMeeGoSwitchEvent::DidSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &didSwitchEvent); } } @@ -94,8 +103,16 @@ void QMeeGoGraphicsSystemHelper::switchToRaster() if (QApplicationPrivate::instance()->graphics_system_name != QLatin1String("runtime")) qWarning("Can't switch to raster - switching only supported with 'runtime' graphics system."); else { + QMeeGoSwitchEvent willSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::WillSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &willSwitchEvent); + QApplication *app = static_cast(QCoreApplication::instance()); app->setGraphicsSystem(QLatin1String("raster")); + + QMeeGoSwitchEvent didSwitchEvent(QLatin1String("raster"), QMeeGoSwitchEvent::DidSwitch); + foreach (QWidget *widget, QApplication::topLevelWidgets()) + QCoreApplication::sendEvent(widget, &didSwitchEvent); } } diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro index 161a31b..360847e 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.pro @@ -6,5 +6,5 @@ include(../../src/qbase.pri) QT += gui INCLUDEPATH += '../../src/plugins/graphicssystems/meego' -HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h -SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp +HEADERS = qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegoswitchevent.h +SOURCES = qmeegographicssystemhelper.cpp qmeegooverlaywidget.cpp qmeegoruntime.cpp qmeegolivepixmap.cpp qmeegographicssystemhelper.h qmeegooverlaywidget.h qmeegolivepixmap.h qmeegoruntime.h qmeegolivepixmap_p.h qmeegofencesync.h qmeegofencesync_p.h qmeegofencesync.cpp qmeegoswitchevent.cpp qmeegoswitchevent.h diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp new file mode 100644 index 0000000..b136ce8 --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.cpp @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmeegoswitchevent.h" + +QMeeGoSwitchEvent::QMeeGoSwitchEvent(const QString &graphicsSystemName, QMeeGoSwitchEvent::State s) : QEvent((QEvent::Type) QMeeGoSwitchEvent::SwitchEvent) +{ + name = graphicsSystemName; + switchState = s; +} + +QString QMeeGoSwitchEvent::graphicsSystemName() const +{ + return name; +} + +QMeeGoSwitchEvent::State QMeeGoSwitchEvent::state() const +{ + return switchState; +} \ No newline at end of file diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h new file mode 100644 index 0000000..a67c6c4 --- /dev/null +++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +class QMeeGoSwitchEvent : public QEvent +{ +public: + enum State { + WillSwitch, + DidSwitch + }; + + enum Type { + SwitchEvent = QEvent::User + 1024 + }; + + QMeeGoSwitchEvent(const QString &graphicsSystemName, State s); + QString graphicsSystemName() const; + State state() const; + + +private: + QString name; + State switchState; +}; -- cgit v0.12 From 0091dcee679c8787f80bc2ed49f263c801779987 Mon Sep 17 00:00:00 2001 From: Michael Dominic K Date: Wed, 17 Nov 2010 10:55:09 +0100 Subject: Documentation update for new switching events. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merge-request: 926 Reviewed-by: Samuel Rødal --- .../qmeegographicssystemhelper.h | 6 +++++ .../qmeegographicssystemhelper/qmeegoswitchevent.h | 26 +++++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h index 2baacbb..d47c829 100644 --- a/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h +++ b/tools/qmeegographicssystemhelper/qmeegographicssystemhelper.h @@ -102,6 +102,9 @@ public: When running with the 'runtime' graphics system, sets the currently active system to 'meego'. The window surface and all the resources are automatically migrated to OpenGL. Will fail if the active graphics system is not 'runtime'. + Calling this function will emit QMeeGoSwitchEvent to the top level widgets. + Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch) + and one after the switch (QMeeGoSwitchEvent::DidSwitch). */ static void switchToMeeGo(); @@ -111,6 +114,9 @@ public: system to 'raster'. The window surface and the graphics resources (including the EGL shared image resources) are automatically migrated back to the CPU. All OpenGL resources (surface, context, cache, font cache) are automaticall anihilated. + Calling this function will emit QMeeGoSwitchEvent to the top level widgets. + Two events will be emitted for each switch -- one before the switch (QMeeGoSwitchEvent::WillSwitch) + and one after the switch (QMeeGoSwitchEvent::DidSwitch). */ static void switchToRaster(); diff --git a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h index a67c6c4..2d8371e 100644 --- a/tools/qmeegographicssystemhelper/qmeegoswitchevent.h +++ b/tools/qmeegographicssystemhelper/qmeegoswitchevent.h @@ -42,22 +42,46 @@ #include #include +//! A custom event representing a graphics system switch. +/*! + This event is sent two times -- before the actual switch and after the switch. + The current mode of the event can be detected by looking at the State of the + event. + + The end-user application can use the event to drop it's own allocated GL resources + when going to software mode. +*/ + class QMeeGoSwitchEvent : public QEvent { public: + + //! The state represented by this event. enum State { WillSwitch, DidSwitch }; + //! The event type id to use to detect this event. enum Type { SwitchEvent = QEvent::User + 1024 }; + //! Constructor for the event. + /*! + Creates a new event with the given name and the given state. + */ QMeeGoSwitchEvent(const QString &graphicsSystemName, State s); + + //! Returns the name of the target graphics system. + /*! + Depending on the state, the name represents the system we're about to swtich to, + or the system we just switched to. + */ QString graphicsSystemName() const; - State state() const; + //! Returns the state represented by this event. + State state() const; private: QString name; -- cgit v0.12 From d68b5355b36e31dbeec2474d8469646358e0cd87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 17 Nov 2010 10:58:57 +0100 Subject: Compile fix. Not sure why this worked before. Reviewed-by: Benjamin Poulain --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index d4a1248..92b54a0 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -3572,7 +3572,7 @@ static QByteArray toLatin1_helper(const QChar *data, int length) } length = length % 16; } -#elif QT_ALWAYS_HAVE_NEON +#elif defined(QT_ALWAYS_HAVE_NEON) // Refer to the documentation of the SSE2 implementation // this use eactly the same method as for SSE except: // 1) neon has unsigned comparison -- cgit v0.12 From 6ad33e1ff7618704fd41549780d0d0c93778364e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 17 Nov 2010 13:01:38 +0100 Subject: Prevent crash in GL 2 engine when stroking null rectangle. Task-number: QTBUG-15320 Reviewed-by: Kim --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 3 +++ tests/auto/qgl/tst_qgl.cpp | 23 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 73915cb..37552ac 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1212,6 +1212,9 @@ void QGL2PaintEngineExPrivate::stroke(const QVectorPath &path, const QPen &pen) stroker.process(dashStroke, pen, clip); } + if (!stroker.vertexCount()) + return; + if (opaque) { prepareForDraw(opaque); setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, stroker.vertices()); diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index e38bf42..cc2cac9 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -97,6 +97,7 @@ private slots: void qglContextDefaultBindTexture(); void textureCleanup(); void threadImages(); + void nullRectCrash(); }; tst_QGL::tst_QGL() @@ -2375,6 +2376,28 @@ void tst_QGL::threadImages() delete widget; } +void tst_QGL::nullRectCrash() +{ + if (!QGLFramebufferObject::hasOpenGLFramebufferObjects()) + QSKIP("QGLFramebufferObject not supported on this platform", SkipSingle); + + QGLWidget glw; + glw.makeCurrent(); + + QGLFramebufferObjectFormat fboFormat; + fboFormat.setAttachment(QGLFramebufferObject::CombinedDepthStencil); + + QGLFramebufferObject *fbo = new QGLFramebufferObject(128, 128, fboFormat); + + QPainter fboPainter(fbo); + + fboPainter.setPen(QPen(QColor(255, 127, 127, 127), 2)); + fboPainter.setBrush(QColor(127, 255, 127, 127)); + fboPainter.drawRect(QRectF()); + + fboPainter.end(); +} + class tst_QGLDummy : public QObject { Q_OBJECT -- cgit v0.12 From 78895a7ecaf6579894d88388c09be6e6368dc029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 16 Nov 2010 14:19:29 +0200 Subject: Fixed crash when destroying QGLWidget The QGLWidget destroys the QGLContext, which in turn destroys the bound pixmap. When this happens there may not be a current QGLContext, so check that before trying to restore it. Done-with: Gunnar Sletta Reviewed-by: Samuel --- src/opengl/qgl_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 4742bdb..b46d428 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -506,7 +506,8 @@ private slots: // when you come to delete the context. QGLContextPrivate::unbindPixmapFromTexture(boundPixmap); glDeleteTextures(1, &id); - oldContext->makeCurrent(); + if (oldContext) + oldContext->makeCurrent(); return; } #endif -- cgit v0.12 From 9f18a1ad5ce32dd397642a4c03fa1fcb21fb9456 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 18 Nov 2010 05:40:36 +0000 Subject: Check correctly before including SSE4.2 header. Previously, this failed machines that only had SSE4.1 but not SSE4.2 due to an assumption that nmmintrin.h could be included when only using SSE4.1. Fixes http://bugreports.qt.nokia.com/browse/QTBUG-13623. Merge-request: 929 Reviewed-by: Benjamin Poulain --- src/corelib/tools/qsimd_p.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index 87fa770..2dbed76 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -87,9 +87,13 @@ QT_BEGIN_HEADER #include #endif -// SSE4.1 and SSE4.2 intrinsics -#if (defined(QT_HAVE_SSE4_1) || defined(QT_HAVE_SSE4_2)) && (defined(__SSE4_1__) || defined(Q_CC_MSVC)) +// SSE4.1 intrinsics +#if defined(QT_HAVE_SSE4_1) && (defined(__SSE4_1__) || defined(Q_CC_MSVC)) #include +#endif + +// SSE4.2 intrinsics +#if defined(QT_HAVE_SSE4_2) && (defined(__SSE4_2__) || defined(Q_CC_MSVC)) #include #endif -- cgit v0.12 From 36ac9c61e73944cd75d09f5751dd8ed053571b9b Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 18 Nov 2010 20:57:20 +1000 Subject: Add missing symbols in QtGui emulator def file --- src/s60installs/bwins/QtGuiu.def | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index c91b22c..dc8a865 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12898,4 +12898,10 @@ EXPORTS ?qmljsDebugArgumentsString@QApplicationPrivate@@SA?AVQString@@XZ @ 12897 NONAME ; class QString QApplicationPrivate::qmljsDebugArgumentsString(void) ?convertToPostscriptFontFamilyName@QFontEngine@@SA?AVQByteArray@@ABV2@@Z @ 12898 NONAME ; class QByteArray QFontEngine::convertToPostscriptFontFamilyName(class QByteArray const &) ?lastResortFont@QFont@@QBE?AVQString@@XZ @ 12899 NONAME ; class QString QFont::lastResortFont(void) const + ?setFontEngine@QStaticTextItem@@QAEXPAVQFontEngine@@@Z @ 12900 NONAME ; void QStaticTextItem::setFontEngine(class QFontEngine *) + ??0QStaticTextItem@@QAE@ABV0@@Z @ 12901 NONAME ; QStaticTextItem::QStaticTextItem(class QStaticTextItem const &) + ??4QStaticTextItem@@QAEXABV0@@Z @ 12902 NONAME ; void QStaticTextItem::operator=(class QStaticTextItem const &) + ?fontEngine@QStaticTextItem@@QBEPAVQFontEngine@@XZ @ 12903 NONAME ; class QFontEngine * QStaticTextItem::fontEngine(void) const + ?reactivateDeferredActiveObjects@QEventDispatcherS60@@UAEXXZ @ 12904 NONAME ; void QEventDispatcherS60::reactivateDeferredActiveObjects(void) + ?userData@QStaticTextItem@@QBEPAVQStaticTextUserData@@XZ @ 12905 NONAME ; class QStaticTextUserData * QStaticTextItem::userData(void) const -- cgit v0.12 From 0ced71e4dddc12240b22fd5786ed41a529e49c47 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 18 Nov 2010 13:35:44 +0100 Subject: Fix parent bug for QDeclarativeOpenMetaObject The dynamic meta object was not called because no parent meta object was called. Reviewed-By: Aaron Kennedy --- src/declarative/util/qdeclarativeopenmetaobject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp index 40485bd..c611435 100644 --- a/src/declarative/util/qdeclarativeopenmetaobject.cpp +++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp @@ -186,6 +186,7 @@ QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, bool automa d->type->d->referers.insert(this); QObjectPrivate *op = QObjectPrivate::get(obj); + d->parent = static_cast(op->metaObject); *static_cast(this) = *d->type->d->mem; op->metaObject = this; } @@ -201,6 +202,7 @@ QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, QDeclarativ d->type->d->referers.insert(this); QObjectPrivate *op = QObjectPrivate::get(obj); + d->parent = static_cast(op->metaObject); *static_cast(this) = *d->type->d->mem; op->metaObject = this; } -- cgit v0.12 From d4cd9c899e705ff01f597f0007def8fbd3ab8b39 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 19 Nov 2010 09:19:41 +1000 Subject: Add a test on QWS Without a single test, it fails anyways. Task-number: QTBUG-14792 --- tests/auto/declarative/qmlvisual/TEST_GUIDELINES | 2 +- tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/TEST_GUIDELINES b/tests/auto/declarative/qmlvisual/TEST_GUIDELINES index cb53b6e..469832f 100644 --- a/tests/auto/declarative/qmlvisual/TEST_GUIDELINES +++ b/tests/auto/declarative/qmlvisual/TEST_GUIDELINES @@ -4,4 +4,4 @@ Guidelines for creating new visual tests: 2. Keep it short. It is hoped that these tests can be run regularly, perhaps even for every commit, and if you add up ten seconds for every time someone commits a change to QML then we'll be sitting here for a long time. Completeness is more important than haste, but consider the most time efficient ways to achieve said completeness. Do not forget about snapshot mode (tst_qmlvisual -help for details on -recordsnapshot) when testing that a static scene looks right. -3. Avoid text. Text is relatively unstable due to platform specific peculiarities. If you need to identify an area, consider a unique color as opposed to a unique text label. If you must use Text, TextEdit, or TextInput, use the test-friendlier versions in the 'shared' directory. +3. Avoid text. Text is relatively unstable due to platform specific peculiarities. If you need to identify an area, consider a unique color as opposed to a unique text label. If you must use Text, TextEdit, or TextInput, use the test-friendlier versions in the 'shared' directory. Also keep in mind that text anti-aliasing is disabled during tests for greater consistency, and you should never use point sizes in tests. Text autotests can thus only test some aspects of the elements. diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp index 8d4d0d1..2a15102 100644 --- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp +++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp @@ -104,14 +104,16 @@ void tst_qmlvisual::visual_data() QStringList files; files << findQmlFiles(QDir(QT_TEST_SOURCE_DIR)); if (qgetenv("QMLVISUAL_ALL") != "1") { - //Text on X11 varies per distro - and the CI system is currently using something outdated. #if defined(Q_WS_X11) + //Text on X11 varies per distro - and the CI system is currently using something outdated. foreach(const QString &str, files.filter(QRegExp(".*text.*"))) files.removeAll(str); #endif - //We don't want QWS test results to mire down the CI system #if defined(Q_WS_QWS) + //We don't want QWS test results to mire down the CI system files.clear(); + //Needs at least one test data or it fails anyways + files << QT_TEST_SOURCE_DIR "/selftest_noimages/selftest_noimages.qml"; #endif } -- cgit v0.12 From 519264c692f77f6da2fb8a9ac2ddb1d70b39cc90 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 19 Nov 2010 10:55:22 +1000 Subject: Doc: clarify Flickable children vs. contentItem children. --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 3a3189c..1870647 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -386,6 +386,13 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd() \snippet doc/src/snippets/declarative/flickable.qml document \clearfloat + + Items declared as children of a Flickable are automatically parented to the + Flickable's \l contentItem. This should be taken into account when + operating on the children of the Flickable; it is usually the children of + \c contentItem that are relevant. For example, the bound of Items added + to the Flickable will be available by \c contentItem.childrenRect + \section1 Limitations \note Due to an implementation detail, items placed inside a Flickable cannot anchor to it by -- cgit v0.12 From f3a80c1128a04c9eb04a28b2fe8b468113731c43 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 19 Nov 2010 13:29:48 +1000 Subject: Add missing symbols to QtOpenGL emulator def file --- src/s60installs/bwins/QtOpenGLu.def | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def index fa340e4..620fcb9 100644 --- a/src/s60installs/bwins/QtOpenGLu.def +++ b/src/s60installs/bwins/QtOpenGLu.def @@ -8,7 +8,7 @@ EXPORTS ?d_func@QGLShader@@AAEPAVQGLShaderPrivate@@XZ @ 7 NONAME ; class QGLShaderPrivate * QGLShader::d_func(void) ?bindToDynamicTexture@QGLPixelBuffer@@QAE_NI@Z @ 8 NONAME ; bool QGLPixelBuffer::bindToDynamicTexture(unsigned int) ??0QGLWidget@@QAE@PAVQGLContext@@PAVQWidget@@PBV0@V?$QFlags@W4WindowType@Qt@@@@@Z @ 9 NONAME ; QGLWidget::QGLWidget(class QGLContext *, class QWidget *, class QGLWidget const *, class QFlags) - ??_EQGLFormat@@QAE@I@Z @ 10 NONAME ; QGLFormat::~QGLFormat(unsigned int) + ??_EQGLFormat@@QAE@I@Z @ 10 NONAME ABSENT ; QGLFormat::~QGLFormat(unsigned int) ?drawPixmapFragments@QGL2PaintEngineEx@@UAEXPBVPixmapFragment@QPainter@@HABVQPixmap@@V?$QFlags@W4PixmapFragmentHint@QPainter@@@@@Z @ 11 NONAME ; void QGL2PaintEngineEx::drawPixmapFragments(class QPainter::PixmapFragment const *, int, class QPixmap const &, class QFlags) ?paintEngine@QGLWidget@@UBEPAVQPaintEngine@@XZ @ 12 NONAME ; class QPaintEngine * QGLWidget::paintEngine(void) const ?setPreferredPaintEngine@QGL@@YAXW4Type@QPaintEngine@@@Z @ 13 NONAME ; void QGL::setPreferredPaintEngine(enum QPaintEngine::Type) @@ -107,7 +107,7 @@ EXPORTS ??0QGLContext@@QAE@ABVQGLFormat@@@Z @ 106 NONAME ; QGLContext::QGLContext(class QGLFormat const &) ?geometryOutputVertexCount@QGLShaderProgram@@QBEHXZ @ 107 NONAME ; int QGLShaderProgram::geometryOutputVertexCount(void) const ?setAccum@QGLFormat@@QAEX_N@Z @ 108 NONAME ; void QGLFormat::setAccum(bool) - ??0QGLSignalProxy@@QAE@XZ @ 109 NONAME ; QGLSignalProxy::QGLSignalProxy(void) + ??0QGLSignalProxy@@QAE@XZ @ 109 NONAME ABSENT ; QGLSignalProxy::QGLSignalProxy(void) ?isUninitialized@QGLPixmapData@@ABE_NXZ @ 110 NONAME ; bool QGLPixmapData::isUninitialized(void) const ??0QGLFramebufferObjectFormat@@QAE@XZ @ 111 NONAME ; QGLFramebufferObjectFormat::QGLFramebufferObjectFormat(void) ??8@YA_NABVQGLFormat@@0@Z @ 112 NONAME ; bool operator==(class QGLFormat const &, class QGLFormat const &) @@ -496,7 +496,7 @@ EXPORTS ?setUniformValue@QGLShaderProgram@@QAEXPBDABVQSize@@@Z @ 495 NONAME ; void QGLShaderProgram::setUniformValue(char const *, class QSize const &) ?convertToGLFormat@QGLWidget@@SA?AVQImage@@ABV2@@Z @ 496 NONAME ; class QImage QGLWidget::convertToGLFormat(class QImage const &) ?staticMetaObject@QGLTextureGlyphCache@@2UQMetaObject@@B @ 497 NONAME ; struct QMetaObject const QGLTextureGlyphCache::staticMetaObject - ??_EQGLContextResource@@QAE@I@Z @ 498 NONAME ; QGLContextResource::~QGLContextResource(unsigned int) + ??_EQGLContextResource@@QAE@I@Z @ 498 NONAME ABSENT ; QGLContextResource::~QGLContextResource(unsigned int) ?handle@QGLColormap@@IAEKXZ @ 499 NONAME ; unsigned long QGLColormap::handle(void) ?isCreated@QGLBuffer@@QBE_NXZ @ 500 NONAME ; bool QGLBuffer::isCreated(void) const ?setColormap@QGLWidget@@QAEXABVQGLColormap@@@Z @ 501 NONAME ; void QGLWidget::setColormap(class QGLColormap const &) @@ -698,4 +698,9 @@ EXPORTS ?setProfile@QGLFormat@@QAEXW4OpenGLContextProfile@1@@Z @ 697 NONAME ; void QGLFormat::setProfile(enum QGLFormat::OpenGLContextProfile) ?updateDynamicTexture@QGLPixelBuffer@@QBEXI@Z @ 698 NONAME ; void QGLPixelBuffer::updateDynamicTexture(unsigned int) const ?setUniformValue@QGLShaderProgram@@QAEXHH@Z @ 699 NONAME ; void QGLShaderProgram::setUniformValue(int, int) + ?maxTextureHeight@QGLTextureGlyphCache@@UBEHXZ @ 700 NONAME ; int QGLTextureGlyphCache::maxTextureHeight(void) const + ?initializeOffscreenTexture@QGLWindowSurface@@AAE_NABVQSize@@@Z @ 701 NONAME ; bool QGLWindowSurface::initializeOffscreenTexture(class QSize const &) + ?maxTextureWidth@QGLTextureGlyphCache@@UBEHXZ @ 702 NONAME ; int QGLTextureGlyphCache::maxTextureWidth(void) const + ?filterMode@QGLTextureGlyphCache@@QBE?AW4FilterMode@1@XZ @ 703 NONAME ; enum QGLTextureGlyphCache::FilterMode QGLTextureGlyphCache::filterMode(void) const + ?setFilterMode@QGLTextureGlyphCache@@QAEXW4FilterMode@1@@Z @ 704 NONAME ; void QGLTextureGlyphCache::setFilterMode(enum QGLTextureGlyphCache::FilterMode) -- cgit v0.12 From abfdba11b8948497765c24670becf39e2ce1ff6d Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 19 Nov 2010 14:40:33 +1000 Subject: Add missing symbols to QtOpenGL arm def file --- src/s60installs/eabi/QtOpenGLu.def | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def index 7ceade4..c92d99e 100644 --- a/src/s60installs/eabi/QtOpenGLu.def +++ b/src/s60installs/eabi/QtOpenGLu.def @@ -702,4 +702,9 @@ EXPORTS _ZeqRK9QGLFormatS1_ @ 701 NONAME _Zls6QDebugRK9QGLFormat @ 702 NONAME _ZneRK9QGLFormatS1_ @ 703 NONAME + _ZN16QGLWindowSurface26initializeOffscreenTextureERK5QSize @ 704 NONAME + _ZNK20QGLTextureGlyphCache15maxTextureWidthEv @ 705 NONAME + _ZNK20QGLTextureGlyphCache16maxTextureHeightEv @ 706 NONAME + _ZThn8_NK20QGLTextureGlyphCache15maxTextureWidthEv @ 707 NONAME + _ZThn8_NK20QGLTextureGlyphCache16maxTextureHeightEv @ 708 NONAME -- cgit v0.12 From ac62887fe00eb22ea00622d4c3dab5ff40417e76 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 19 Nov 2010 16:23:52 +1000 Subject: Don't leak QML compiled data objects Task-number: QTBUG-14761 --- src/declarative/qml/qdeclarativecompileddata.cpp | 4 ++-- src/declarative/qml/qdeclarativecompiler.cpp | 2 -- src/declarative/qml/qdeclarativecompiler_p.h | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompileddata.cpp b/src/declarative/qml/qdeclarativecompileddata.cpp index a4ecc77..690f499 100644 --- a/src/declarative/qml/qdeclarativecompileddata.cpp +++ b/src/declarative/qml/qdeclarativecompileddata.cpp @@ -169,8 +169,8 @@ QDeclarativeCompiledData::QDeclarativeCompiledData(QDeclarativeEngine *engine) QDeclarativeCompiledData::~QDeclarativeCompiledData() { for (int ii = 0; ii < types.count(); ++ii) { - if (types.at(ii).ref) - types.at(ii).ref->release(); + if (types.at(ii).component) + types.at(ii).component->release(); } for (int ii = 0; ii < propertyCaches.count(); ++ii) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b2740b8..645402e 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -591,8 +591,6 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine, } } else if (tref.typeData) { ref.component = tref.typeData->compiledData(); - ref.ref = tref.typeData; - ref.ref->addref(); } ref.className = parserRef->name.toUtf8(); out->types << ref; diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h index 43a0901..5cd1fd2 100644 --- a/src/declarative/qml/qdeclarativecompiler_p.h +++ b/src/declarative/qml/qdeclarativecompiler_p.h @@ -89,14 +89,12 @@ public: struct TypeReference { TypeReference() - : type(0), component(0), ref(0) {} + : type(0), component(0) {} QByteArray className; QDeclarativeType *type; -// QDeclarativeComponent *component; QDeclarativeCompiledData *component; - QDeclarativeRefCount *ref; QObject *createInstance(QDeclarativeContextData *, const QBitField &, QList *) const; const QMetaObject *metaObject() const; }; -- cgit v0.12 From 1119a86b9752a1a58dade499a2884b89b2275a57 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 19 Nov 2010 16:34:05 +1000 Subject: Allow testing of raster engine on Mac from qmlviewer --- tools/qml/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 579f1ab..209c72f 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -155,7 +155,11 @@ void usage() qWarning(" -I ........................... prepend to the module import search path,"); qWarning(" display path if is empty"); qWarning(" -P ........................... prepend to the plugin search path"); +#if defined(Q_WS_MAC) + qWarning(" -no-opengl ............................... don't use a QGLWidget for the viewport"); +#else qWarning(" -opengl .................................. use a QGLWidget for the viewport"); +#endif qWarning(" -script ........................... set the script to use"); qWarning(" -scriptopts |help ............... set the script options to use"); @@ -370,8 +374,13 @@ static void parseCommandLineOptions(const QStringList &arguments) } else if (arg == "-translation") { if (lastArg) usage(); opts.translationFile = arguments.at(++i); +#if defined(Q_WS_MAC) + } else if (arg == "-no-opengl") { + opts.useGL = false; +#else } else if (arg == "-opengl") { opts.useGL = true; +#endif } else if (arg == "-qmlbrowser") { opts.useNativeFileBrowser = false; } else if (arg == "-warnings") { -- cgit v0.12 From 1960713543e2a5fee76df7dbf06ea70cf277d696 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 19 Nov 2010 18:29:11 +1000 Subject: Initial commit of qmlvisualaids A tool to make it easier to do the platform visual updating. Needs to be streamlined at least a little in order to make it feasible to stay up to date. Task-number: QTBUG-14792 --- .../qmlvisual/shared/qmlvisualaids/Button.qml | 19 +++++ .../qmlvisual/shared/qmlvisualaids/Comparison.qml | 75 +++++++++++++++++ .../qmlvisual/shared/qmlvisualaids/main.cpp | 14 ++++ .../qmlvisual/shared/qmlvisualaids/mainwindow.cpp | 74 +++++++++++++++++ .../qmlvisual/shared/qmlvisualaids/mainwindow.h | 31 +++++++ .../qmlvisual/shared/qmlvisualaids/qmlvisual.pro | 26 ++++++ .../qmlvisual/shared/qmlvisualaids/qmlvisual.qrc | 6 ++ .../qmlvisual/shared/qmlvisualaids/testmodel.cpp | 96 ++++++++++++++++++++++ .../qmlvisual/shared/qmlvisualaids/testmodel.h | 50 +++++++++++ 9 files changed, 391 insertions(+) create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml new file mode 100644 index 0000000..600079f --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml @@ -0,0 +1,19 @@ +import Qt 4.7 + +Rectangle { + width: txt.width + 16 + height: txt.height + 8 + radius: 4 + border.color: "black" + property alias caption: txt.text + signal triggered + Text{ + id: txt + text: "Button" + anchors.centerIn: parent + } + MouseArea{ + anchors.fill: parent + onClicked: parent.triggered() + } +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml new file mode 100644 index 0000000..43b10d4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml @@ -0,0 +1,75 @@ +import Qt 4.7 + +Item{ + width: 1000 + height:800 + Row{ + spacing: 4 + Button{ + caption: "run" + onTriggered: test.runTest() + } + + Button{ + caption: "update" + onTriggered: test.updateVisuals() + } + + Button{ + caption: "platform" + onTriggered: test.updatePlatformVisuals() + } + } + + Rectangle { + y: 180 + width: 1000 + height: 620 + Row{ + id: grid + spacing: 4 + Text{ + width: 300 + height: 200 + text: test.testName + clip: true; wrapMode: Text.WordWrap + } + Text{ + width: 300 + height: 200 + text: test.testCase + clip: true; wrapMode: Text.WordWrap + } + Text{ + width: 300 + height: 200 + text: test.testScript + clip: true; wrapMode: Text.WordWrap + } + } + Item{ + y: 200 + Row{ + ListView{ + width: 200; height: 400 + delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} + model: test.goodImages; + } + ListView{ + width: 200; height: 400 + delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} + model: test.diffImages; + } + ListView{ + width: 200; height: 400 + delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} + model: test.badImages; + } + } + } + MouseArea{ + anchors.fill: parent + onClicked: test.moveOn(); + } + } +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp new file mode 100644 index 0000000..2d35350 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp @@ -0,0 +1,14 @@ +#include +#include +#include "mainwindow.h" +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow *m = new MainWindow; + m->show(); + return a.exec(); +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp new file mode 100644 index 0000000..49614ec --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp @@ -0,0 +1,74 @@ +#include "mainwindow.h" +#include +#include + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), testIdx(-1) +{ + createMenus(); + view = new QDeclarativeView(this); + setCentralWidget(view); + view->setResizeMode(QDeclarativeView::SizeViewToRootObject); + curTest = new TestModel(this); + connect(curTest, SIGNAL(moveOn()), + this, SLOT(runTests())); + + view->engine()->rootContext()->setContextProperty("test", curTest); + view->setSource(QUrl("qrc:qml/Comparison.qml")); +} + +void MainWindow::runAllTests() +{ + tests.clear(); + testIdx = 0; + + QString visualTest = "./tst_qmlvisual";//TODO: Crossplatform + + QProcess p;//TODO: Error checking here + p.setProcessChannelMode(QProcess::MergedChannels); + p.start(visualTest, QStringList()); + p.waitForFinished(-1);//Can't time out, because it takes an indeterminate and long time + + QString output = QString(p.readAllStandardOutput()); + QRegExp re("QDeclarativeTester\\( \"([^\"]*)\" \\)"); + int offset=0; + while((offset = re.indexIn(output, offset)) != -1){ + tests << re.cap(1); + offset++; + } + + if(tests.count()) + QMessageBox::information(this, "Test Results", QString("Tests completed. %1 test failures occurred.").arg(tests.count())); + else + QMessageBox::information(this, "Test Results", "Tests completed. All tests passed!"); + + runTests(); +} + +void MainWindow::runTests() +{ + if(testIdx >= tests.size()) + testIdx = -1; + if(testIdx == -1) + return; + showFixScreen(tests[testIdx++]); +} + +void MainWindow::showFixScreen(const QString &path) +{ + if(curTest->setTest(path)){ + view->engine()->rootContext()->setContextProperty("test", curTest); //signal connects to runTests + }else{ + QMessageBox::critical(this, "Test Error", QString("Cannot find test %1.").arg(path)); + runTests(); + } +} + +void MainWindow::createMenus() +{ + QMenu *tests = this->menuBar()->addMenu("Tests"); + tests->addAction("Run All", this, SLOT(runAllTests())); + tests->addSeparator(); + tests->addAction("About Qt...", qApp, SLOT(aboutQt())); + tests->addAction("Quit", qApp, SLOT(quit())); +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h new file mode 100644 index 0000000..0209064 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h @@ -0,0 +1,31 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include "testmodel.h" + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + explicit MainWindow(QWidget *parent = 0); + void createMenus(); + +signals: + +public slots: + void runTests(); + void runAllTests(); + void showFixScreen(const QString& path); + +private: + QDeclarativeView* view; + TestModel *curTest; + QStringList tests; + int testIdx; +}; + +#endif // MAINWINDOW_H diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro new file mode 100644 index 0000000..d18c235 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro @@ -0,0 +1,26 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2010-11-19T09:48:39 +# +#------------------------------------------------- + +QT += core gui declarative + +TARGET = ../../qmlvisualaids +TEMPLATE = app + + +SOURCES += main.cpp \ + testmodel.cpp \ + mainwindow.cpp + +HEADERS += \ + testmodel.h \ + mainwindow.h + +OTHER_FILES += \ + Comparison.qml \ + Button.qml + +RESOURCES += \ + qmlvisual.qrc diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc new file mode 100644 index 0000000..d79b64c --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc @@ -0,0 +1,6 @@ + + + Comparison.qml + Button.qml + + diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp new file mode 100644 index 0000000..4aec14b --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp @@ -0,0 +1,96 @@ +#include "testmodel.h" +#include +#include +#include + +TestModel::TestModel(QObject *parent) : + QObject(parent), _testName("Invalid") +{ + +} + +//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above +bool TestModel::setTest(const QString &testPath) +{ + _good.clear(); + _bad.clear(); + _diff.clear(); + + _testScriptPath = testPath; + if(!_testScriptPath.endsWith(".qml")) + _testScriptPath += ".qml"; + _testName = _testScriptPath.split('/').last(); + + //Assumed that the test case is in the directory above and has the same name as the script + _testPath = _testScriptPath.left(_testScriptPath.lastIndexOf('/', _testScriptPath.lastIndexOf('/') - 1)) + + '/' + _testName; + + bool ret = QFile::exists(_testPath) && QFile::exists(_testScriptPath); + if(!ret) + return ret; + + QFile test(_testPath); + test.open(QFile::ReadOnly | QFile::Text); + _testCase = test.readAll(); + + QFile script(_testScriptPath); + script.open(QFile::ReadOnly | QFile::Text); + _testScript = script.readAll(); + + QString base = _testScriptPath; + base.chop(4);//remove .qml, replace with .%1.png + base += ".%1.png"; + int c = 0; + while (QFile::exists(base.arg(c))) { + _good << "file://" + base.arg(c); + if(QFile::exists(base.arg(c) + ".reject.png")) + _bad << "file://" + base.arg(c) + ".reject.png"; + else + _bad << ""; + + if(QFile::exists(base.arg(c) + ".diff.png")) + _diff << "file://" + base.arg(c) + ".diff.png"; + else + _diff << ""; + + c++; + } + + return ret; +} + +//returns true iff running the test changed the failure images. +bool TestModel::runTest() +{ + launchTester("-play"); + return false;//TODO: Actually check that +} + +void TestModel::updateVisuals() +{ + launchTester("-updatevisuals"); +} + +void TestModel::updatePlatformVisuals() +{ + launchTester("-updateplatformvisuals"); +} + +void TestModel::launchTester(const QString &args) +{ + QStringList arguments; + arguments << args << _testPath; + + QString visualTest; +#if defined(Q_WS_WIN) || defined(Q_WS_S60) + visualTest = "tst_qmlvisual.exe"; +#else + visualTest = "./tst_qmlvisual"; +#endif + + QProcess p; + p.setProcessChannelMode(QProcess::ForwardedChannels); + p.start(visualTest, arguments); + p.waitForFinished(); +} + diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h new file mode 100644 index 0000000..fd64dc2 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h @@ -0,0 +1,50 @@ +#ifndef TESTMODEL_H +#define TESTMODEL_H + +#include +#include +#include + +class TestModel : public QObject +{ + Q_OBJECT + Q_PROPERTY(int snapshotCount READ snapshotCount CONSTANT) + Q_PROPERTY(QStringList goodImages READ goodImages CONSTANT)//List of image locatoins + Q_PROPERTY(QStringList badImages READ badImages CONSTANT) + Q_PROPERTY(QStringList diffImages READ diffImages CONSTANT) + Q_PROPERTY(QString testName READ testName CONSTANT) //The qml file name + Q_PROPERTY(QString testCase READ testCase CONSTANT) //The actual contents, not the location + Q_PROPERTY(QString testScript READ testScript CONSTANT) //The actual contents, not the location +public: + explicit TestModel(QObject *parent = 0); + bool setTest(const QString &testPath);//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above + + int snapshotCount() { return _count; } + QString testCase() { return _testCase; } + QString testName() { return _testName; } + QString testScript() {return _testScript; } + QStringList goodImages() {return _good;} + QStringList badImages() { return _bad; } + QStringList diffImages() {return _diff;} + +signals: + void moveOn(); + +public slots: + bool runTest();//returns true iff running the test changed the failure images. + void updateVisuals(); + void updatePlatformVisuals(); + +private: + void launchTester(const QString &args); + + int _count; + QStringList _good,_bad,_diff; + QString _testCase; + QString _testScript; + QString _testPath; + QString _testScriptPath; + QString _testName; +}; + +#endif // TESTMODEL_H -- cgit v0.12 From 18205faa87abd85d0848291738821666928b5769 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 19 Nov 2010 19:31:01 +1000 Subject: Move qmlvisualaids to another repo Moved to a personal repo, since its fate is a little uncertain so it shouldn't draw this much attention. Task-number: QTBUG-14792 --- .../qmlvisual/shared/qmlvisualaids/Button.qml | 19 ----- .../qmlvisual/shared/qmlvisualaids/Comparison.qml | 75 ----------------- .../qmlvisual/shared/qmlvisualaids/main.cpp | 14 ---- .../qmlvisual/shared/qmlvisualaids/mainwindow.cpp | 74 ----------------- .../qmlvisual/shared/qmlvisualaids/mainwindow.h | 31 ------- .../qmlvisual/shared/qmlvisualaids/qmlvisual.pro | 26 ------ .../qmlvisual/shared/qmlvisualaids/qmlvisual.qrc | 6 -- .../qmlvisual/shared/qmlvisualaids/testmodel.cpp | 96 ---------------------- .../qmlvisual/shared/qmlvisualaids/testmodel.h | 50 ----------- 9 files changed, 391 deletions(-) delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml deleted file mode 100644 index 600079f..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml +++ /dev/null @@ -1,19 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: txt.width + 16 - height: txt.height + 8 - radius: 4 - border.color: "black" - property alias caption: txt.text - signal triggered - Text{ - id: txt - text: "Button" - anchors.centerIn: parent - } - MouseArea{ - anchors.fill: parent - onClicked: parent.triggered() - } -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml deleted file mode 100644 index 43b10d4..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml +++ /dev/null @@ -1,75 +0,0 @@ -import Qt 4.7 - -Item{ - width: 1000 - height:800 - Row{ - spacing: 4 - Button{ - caption: "run" - onTriggered: test.runTest() - } - - Button{ - caption: "update" - onTriggered: test.updateVisuals() - } - - Button{ - caption: "platform" - onTriggered: test.updatePlatformVisuals() - } - } - - Rectangle { - y: 180 - width: 1000 - height: 620 - Row{ - id: grid - spacing: 4 - Text{ - width: 300 - height: 200 - text: test.testName - clip: true; wrapMode: Text.WordWrap - } - Text{ - width: 300 - height: 200 - text: test.testCase - clip: true; wrapMode: Text.WordWrap - } - Text{ - width: 300 - height: 200 - text: test.testScript - clip: true; wrapMode: Text.WordWrap - } - } - Item{ - y: 200 - Row{ - ListView{ - width: 200; height: 400 - delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} - model: test.goodImages; - } - ListView{ - width: 200; height: 400 - delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} - model: test.diffImages; - } - ListView{ - width: 200; height: 400 - delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} - model: test.badImages; - } - } - } - MouseArea{ - anchors.fill: parent - onClicked: test.moveOn(); - } - } -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp deleted file mode 100644 index 2d35350..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include -#include "mainwindow.h" -#include -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow *m = new MainWindow; - m->show(); - return a.exec(); -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp deleted file mode 100644 index 49614ec..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "mainwindow.h" -#include -#include - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), testIdx(-1) -{ - createMenus(); - view = new QDeclarativeView(this); - setCentralWidget(view); - view->setResizeMode(QDeclarativeView::SizeViewToRootObject); - curTest = new TestModel(this); - connect(curTest, SIGNAL(moveOn()), - this, SLOT(runTests())); - - view->engine()->rootContext()->setContextProperty("test", curTest); - view->setSource(QUrl("qrc:qml/Comparison.qml")); -} - -void MainWindow::runAllTests() -{ - tests.clear(); - testIdx = 0; - - QString visualTest = "./tst_qmlvisual";//TODO: Crossplatform - - QProcess p;//TODO: Error checking here - p.setProcessChannelMode(QProcess::MergedChannels); - p.start(visualTest, QStringList()); - p.waitForFinished(-1);//Can't time out, because it takes an indeterminate and long time - - QString output = QString(p.readAllStandardOutput()); - QRegExp re("QDeclarativeTester\\( \"([^\"]*)\" \\)"); - int offset=0; - while((offset = re.indexIn(output, offset)) != -1){ - tests << re.cap(1); - offset++; - } - - if(tests.count()) - QMessageBox::information(this, "Test Results", QString("Tests completed. %1 test failures occurred.").arg(tests.count())); - else - QMessageBox::information(this, "Test Results", "Tests completed. All tests passed!"); - - runTests(); -} - -void MainWindow::runTests() -{ - if(testIdx >= tests.size()) - testIdx = -1; - if(testIdx == -1) - return; - showFixScreen(tests[testIdx++]); -} - -void MainWindow::showFixScreen(const QString &path) -{ - if(curTest->setTest(path)){ - view->engine()->rootContext()->setContextProperty("test", curTest); //signal connects to runTests - }else{ - QMessageBox::critical(this, "Test Error", QString("Cannot find test %1.").arg(path)); - runTests(); - } -} - -void MainWindow::createMenus() -{ - QMenu *tests = this->menuBar()->addMenu("Tests"); - tests->addAction("Run All", this, SLOT(runAllTests())); - tests->addSeparator(); - tests->addAction("About Qt...", qApp, SLOT(aboutQt())); - tests->addAction("Quit", qApp, SLOT(quit())); -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h deleted file mode 100644 index 0209064..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include -#include -#include "testmodel.h" - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - explicit MainWindow(QWidget *parent = 0); - void createMenus(); - -signals: - -public slots: - void runTests(); - void runAllTests(); - void showFixScreen(const QString& path); - -private: - QDeclarativeView* view; - TestModel *curTest; - QStringList tests; - int testIdx; -}; - -#endif // MAINWINDOW_H diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro deleted file mode 100644 index d18c235..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2010-11-19T09:48:39 -# -#------------------------------------------------- - -QT += core gui declarative - -TARGET = ../../qmlvisualaids -TEMPLATE = app - - -SOURCES += main.cpp \ - testmodel.cpp \ - mainwindow.cpp - -HEADERS += \ - testmodel.h \ - mainwindow.h - -OTHER_FILES += \ - Comparison.qml \ - Button.qml - -RESOURCES += \ - qmlvisual.qrc diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc deleted file mode 100644 index d79b64c..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - Comparison.qml - Button.qml - - diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp deleted file mode 100644 index 4aec14b..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "testmodel.h" -#include -#include -#include - -TestModel::TestModel(QObject *parent) : - QObject(parent), _testName("Invalid") -{ - -} - -//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above -bool TestModel::setTest(const QString &testPath) -{ - _good.clear(); - _bad.clear(); - _diff.clear(); - - _testScriptPath = testPath; - if(!_testScriptPath.endsWith(".qml")) - _testScriptPath += ".qml"; - _testName = _testScriptPath.split('/').last(); - - //Assumed that the test case is in the directory above and has the same name as the script - _testPath = _testScriptPath.left(_testScriptPath.lastIndexOf('/', _testScriptPath.lastIndexOf('/') - 1)) - + '/' + _testName; - - bool ret = QFile::exists(_testPath) && QFile::exists(_testScriptPath); - if(!ret) - return ret; - - QFile test(_testPath); - test.open(QFile::ReadOnly | QFile::Text); - _testCase = test.readAll(); - - QFile script(_testScriptPath); - script.open(QFile::ReadOnly | QFile::Text); - _testScript = script.readAll(); - - QString base = _testScriptPath; - base.chop(4);//remove .qml, replace with .%1.png - base += ".%1.png"; - int c = 0; - while (QFile::exists(base.arg(c))) { - _good << "file://" + base.arg(c); - if(QFile::exists(base.arg(c) + ".reject.png")) - _bad << "file://" + base.arg(c) + ".reject.png"; - else - _bad << ""; - - if(QFile::exists(base.arg(c) + ".diff.png")) - _diff << "file://" + base.arg(c) + ".diff.png"; - else - _diff << ""; - - c++; - } - - return ret; -} - -//returns true iff running the test changed the failure images. -bool TestModel::runTest() -{ - launchTester("-play"); - return false;//TODO: Actually check that -} - -void TestModel::updateVisuals() -{ - launchTester("-updatevisuals"); -} - -void TestModel::updatePlatformVisuals() -{ - launchTester("-updateplatformvisuals"); -} - -void TestModel::launchTester(const QString &args) -{ - QStringList arguments; - arguments << args << _testPath; - - QString visualTest; -#if defined(Q_WS_WIN) || defined(Q_WS_S60) - visualTest = "tst_qmlvisual.exe"; -#else - visualTest = "./tst_qmlvisual"; -#endif - - QProcess p; - p.setProcessChannelMode(QProcess::ForwardedChannels); - p.start(visualTest, arguments); - p.waitForFinished(); -} - diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h deleted file mode 100644 index fd64dc2..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef TESTMODEL_H -#define TESTMODEL_H - -#include -#include -#include - -class TestModel : public QObject -{ - Q_OBJECT - Q_PROPERTY(int snapshotCount READ snapshotCount CONSTANT) - Q_PROPERTY(QStringList goodImages READ goodImages CONSTANT)//List of image locatoins - Q_PROPERTY(QStringList badImages READ badImages CONSTANT) - Q_PROPERTY(QStringList diffImages READ diffImages CONSTANT) - Q_PROPERTY(QString testName READ testName CONSTANT) //The qml file name - Q_PROPERTY(QString testCase READ testCase CONSTANT) //The actual contents, not the location - Q_PROPERTY(QString testScript READ testScript CONSTANT) //The actual contents, not the location -public: - explicit TestModel(QObject *parent = 0); - bool setTest(const QString &testPath);//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above - - int snapshotCount() { return _count; } - QString testCase() { return _testCase; } - QString testName() { return _testName; } - QString testScript() {return _testScript; } - QStringList goodImages() {return _good;} - QStringList badImages() { return _bad; } - QStringList diffImages() {return _diff;} - -signals: - void moveOn(); - -public slots: - bool runTest();//returns true iff running the test changed the failure images. - void updateVisuals(); - void updatePlatformVisuals(); - -private: - void launchTester(const QString &args); - - int _count; - QStringList _good,_bad,_diff; - QString _testCase; - QString _testScript; - QString _testPath; - QString _testScriptPath; - QString _testName; -}; - -#endif // TESTMODEL_H -- cgit v0.12 From 72f161739b270b01807f97cd853030440f0fd430 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 19 Nov 2010 12:38:36 +0100 Subject: Fix possible corrupted text when gl glyph cache becomes full When the OpenGL glyph cache filled up (the max texture size on the hardware was exceeded) the characters would be drawn as black blocks instead. As a work-around for this, the cache will now be cleared and repopulated whenever this happens, meaning that once in a while (when a lot of different glyphs have been drawn in a font) there will be a performance hit. A more complete solution is described in QTBUG-13784, but this requires so much refactoring that it was deemed too risky for a patch release. This patch fixes the problem with a small penalty and low risk. Task-number: QT-3971 Reviewed-by: Samuel --- src/gui/painting/qtextureglyphcache.cpp | 13 ++++++++++--- src/gui/painting/qtextureglyphcache_p.h | 2 +- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 9 +++++++-- src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp | 19 ++++++++++++++++++- src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h | 2 ++ 5 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index b609f7b..2cd7780 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -65,7 +65,7 @@ static inline int qt_next_power_of_two(int v) return v; } -void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, +bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *) { #ifdef CACHE_DEBUG @@ -119,7 +119,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const rowHeight = qMax(rowHeight, glyph_height); } if (listItemCoordinates.isEmpty()) - return; + return true; rowHeight += margin * 2 + paddingDoubled; if (isNull()) @@ -150,6 +150,13 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const int new_height = m_h*2; while (new_height < m_cy + c.h) new_height *= 2; + + if (new_height > maxTextureHeight()) { + // We can't make a new texture of the required size, so + // bail out + return false; + } + // if no room in the current texture - realloc a larger texture resizeTextureData(m_w, new_height); m_h = new_height; @@ -165,7 +172,7 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const ++iter; } - + return true; } QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g) const diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index e6d2b22..f84d1e6 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -96,7 +96,7 @@ public: int baseLineY; }; - void populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, + bool populate(QFontEngine *fontEngine, int numGlyphs, const glyph_t *glyphs, const QFixedPoint *positions); virtual void createTextureData(int width, int height) = 0; diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 37552ac..3ddc15a 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1499,8 +1499,13 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp // cache so this text is performed before we test if the cache size has changed. if (recreateVertexArrays) { cache->setPaintEnginePrivate(this); - cache->populate(staticTextItem->fontEngine(), staticTextItem->numGlyphs, - staticTextItem->glyphs, staticTextItem->glyphPositions); + if (!cache->populate(staticTextItem->fontEngine(), staticTextItem->numGlyphs, + staticTextItem->glyphs, staticTextItem->glyphPositions)) { + // No space in cache. We need to clear the cache and try again + cache->clear(); + cache->populate(staticTextItem->fontEngine(), staticTextItem->numGlyphs, + staticTextItem->glyphs, staticTextItem->glyphPositions); + } } if (cache->width() == 0 || cache->height() == 0) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp index 28e8c40..705ad09 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl.cpp @@ -78,7 +78,7 @@ void QGLTextureGlyphCache::setContext(QGLContext *context) SLOT(contextDestroyed(const QGLContext*))); } -QGLTextureGlyphCache::~QGLTextureGlyphCache() +void QGLTextureGlyphCache::clear() { if (ctx) { QGLShareContextScope scope(ctx); @@ -88,7 +88,24 @@ QGLTextureGlyphCache::~QGLTextureGlyphCache() if (m_width || m_height) glDeleteTextures(1, &m_texture); + + m_fbo = 0; + m_texture = 0; + m_width = 0; + m_height = 0; + m_w = 0; + m_h = 0; + m_cx = 0; + m_cy = 0; + m_currentRowHeight = 0; + coords.clear(); } + +} + +QGLTextureGlyphCache::~QGLTextureGlyphCache() +{ + clear(); } void QGLTextureGlyphCache::createTextureData(int width, int height) diff --git a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h index fa2b091..aaef350 100644 --- a/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h +++ b/src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h @@ -124,6 +124,8 @@ public Q_SLOTS: } } + void clear(); + private: QGLContext *ctx; -- cgit v0.12 From 649719c29bc3b33ab6a5eb9577d53bd0ba897550 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 19 Nov 2010 14:38:58 +0100 Subject: Fix possible missing glyphs in raster engine glyph cache Two possible failures when using the glyph cache on raster engine and populating the cache with very many glyphs: 1. Change 72f161739b270b01807f97cd853030440f0fd430 caused the maximum height of the glyph cache to be 32768, which was not sufficient for large fonts with very many characters (e.g. Chinese text) 2. Since we are using QPainter to draw into the glyph cache for RGB32 glyphcaches, and QPainter does not support very high coordinates, we need to create a reference image that references a section of the glyph cache and paint into that instead. Task-number: QT-3971 Reviewed-by: Samuel --- src/gui/painting/qtextureglyphcache.cpp | 21 ++++++++++++--------- src/gui/painting/qtextureglyphcache_p.h | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 2cd7780..2daa1f0 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -151,11 +151,11 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const while (new_height < m_cy + c.h) new_height *= 2; - if (new_height > maxTextureHeight()) { - // We can't make a new texture of the required size, so - // bail out - return false; - } + if (maxTextureHeight() > 0 && new_height > maxTextureHeight()) { + // We can't make a new texture of the required size, so + // bail out + return false; + } // if no room in the current texture - realloc a larger texture resizeTextureData(m_w, new_height); @@ -266,11 +266,14 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g) } #endif - if (m_type == QFontEngineGlyphCache::Raster_RGBMask) { - QPainter p(&m_image); + if (m_type == QFontEngineGlyphCache::Raster_RGBMask) { + QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()), + qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(), + m_image.format()); + QPainter p(&ref); p.setCompositionMode(QPainter::CompositionMode_Source); - p.fillRect(c.x, c.y, c.w, c.h, QColor(0,0,0,0)); // TODO optimize this - p.drawImage(c.x, c.y, mask); + p.fillRect(0, 0, c.w, c.h, QColor(0,0,0,0)); // TODO optimize this + p.drawImage(0, 0, mask); p.end(); } else if (m_type == QFontEngineGlyphCache::Raster_Mono) { if (mask.depth() > 1) { diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index f84d1e6..94cb555 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -118,7 +118,7 @@ public: QImage textureMapForGlyph(glyph_t g) const; virtual int maxTextureWidth() const { return QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH; } - virtual int maxTextureHeight() const { return 32768; } + virtual int maxTextureHeight() const { return -1; } protected: QFontEngine *m_current_fontengine; -- cgit v0.12 From c82ba87a0e8e416099e95898386ea25c790c3da3 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Fri, 19 Nov 2010 16:16:46 +0100 Subject: Doc: Fixing typo. --- tests/auto/qkeysequence/tst_qkeysequence.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/qkeysequence/tst_qkeysequence.cpp b/tests/auto/qkeysequence/tst_qkeysequence.cpp index 60f022f..55c7edf 100644 --- a/tests/auto/qkeysequence/tst_qkeysequence.cpp +++ b/tests/auto/qkeysequence/tst_qkeysequence.cpp @@ -405,7 +405,7 @@ void tst_QKeySequence::mnemonic() #ifndef QT_NO_DEBUG if (warning) { - QString str = QString::fromLatin1("QKeySequence::mnemonic: \"%1\" contains multiple occurences of '&'").arg(string); + QString str = QString::fromLatin1("QKeySequence::mnemonic: \"%1\" contains multiple occurrences of '&'").arg(string); QTest::ignoreMessage(QtWarningMsg, qPrintable(str)); // qWarning(qPrintable(str)); } -- cgit v0.12