diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp | 36 | ||||
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc | 2 | ||||
-rw-r--r-- | src/corelib/global/qendian.qdoc | 2 | ||||
-rw-r--r-- | src/corelib/global/qglobal.cpp | 10 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 18 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 41 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 5 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition.cpp | 6 | ||||
-rw-r--r-- | src/corelib/statemachine/qeventtransition.h | 6 | ||||
-rw-r--r-- | src/corelib/tools/qalgorithms.qdoc | 4 | ||||
-rw-r--r-- | src/gui/egl/qegl.cpp | 2 | ||||
-rw-r--r-- | src/gui/egl/qegl_p.h | 4 | ||||
-rw-r--r-- | src/gui/egl/qeglproperties.cpp | 14 | ||||
-rw-r--r-- | src/gui/egl/qeglproperties_p.h | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout.cpp | 15 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsanchorlayout_p.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 8 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 51 | ||||
-rw-r--r-- | src/opengl/qgl_p.h | 1 | ||||
-rw-r--r-- | src/script/script.pro | 9 |
20 files changed, 147 insertions, 91 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp index c78466e..3af4a29 100644 --- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp @@ -471,9 +471,12 @@ NEVER_INLINE bool Interpreter::unwindCallFrame(CallFrame*& callFrame, JSValue ex if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); - if (callFrame->callee()) + if (callFrame->callee()) { debugger->returnEvent(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->lastLine()); - else +#ifdef QT_BUILD_SCRIPT_LIB + debugger->functionExit(exceptionValue, codeBlock->ownerNode()->sourceID()); +#endif + } else debugger->didExecuteProgram(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->lastLine()); } @@ -575,19 +578,32 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV // Calculate an exception handler vPC, unwinding call frames as necessary. HandlerInfo* handler = 0; - while (!(handler = codeBlock->handlerForBytecodeOffset(bytecodeOffset))) { - if (!unwindCallFrame(callFrame, exceptionValue, bytecodeOffset, codeBlock)) { + #ifdef QT_BUILD_SCRIPT_LIB - if (debugger) - debugger->exceptionThrow(DebuggerCallFrame(callFrame, exceptionValue), codeBlock->ownerNode()->sourceID(),false); -#endif - return 0; + //try to find handler + bool hasHandler = true; + CallFrame *callFrameTemp = callFrame; + unsigned bytecodeOffsetTemp = bytecodeOffset; + CodeBlock *codeBlockTemp = codeBlock; + while (!(handler = codeBlockTemp->handlerForBytecodeOffset(bytecodeOffsetTemp))) { + callFrameTemp = callFrameTemp->callerFrame(); + if (callFrameTemp->hasHostCallFrameFlag()) { + hasHandler = false; + break; + } else { + codeBlockTemp = callFrameTemp->codeBlock(); + bytecodeOffsetTemp = bytecodeOffsetForPC(callFrameTemp, codeBlockTemp, callFrameTemp->returnPC()); } } -#ifdef QT_BUILD_SCRIPT_LIB if (debugger) - debugger->exceptionThrow(DebuggerCallFrame(callFrame, exceptionValue), codeBlock->ownerNode()->sourceID(),true); + debugger->exceptionThrow(DebuggerCallFrame(callFrame, exceptionValue), codeBlock->ownerNode()->sourceID(), hasHandler); #endif + + while (!(handler = codeBlock->handlerForBytecodeOffset(bytecodeOffset))) { + if (!unwindCallFrame(callFrame, exceptionValue, bytecodeOffset, codeBlock)) { + return 0; + } + } // Now unwind the scope chain within the exception handler's call frame. ScopeChainNode* scopeChain = callFrame->scopeChain(); diff --git a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc index 144feb5..e3c904b 100644 --- a/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc +++ b/src/3rdparty/webkit/WebKit/qt/docs/qtwebkit.qdoc @@ -1,7 +1,7 @@ /*! \module QtWebKit \title QtWebKit Module - \contentspage Qt's Modules + \contentspage All Qt Modules \previouspage QtSvg \nextpage QtXml \ingroup modules diff --git a/src/corelib/global/qendian.qdoc b/src/corelib/global/qendian.qdoc index e0ef662..949f7b8 100644 --- a/src/corelib/global/qendian.qdoc +++ b/src/corelib/global/qendian.qdoc @@ -42,7 +42,7 @@ /*! \headerfile <QtEndian> \title Endian Conversion Functions - \ingroup classlists + \ingroup funclists \brief The <QtEndian> header provides functions to convert between little and big endian representations of numbers. */ diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index c4fbc49..d7ae78f 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -408,13 +408,13 @@ QT_BEGIN_NAMESPACE /*! \headerfile <QtGlobal> \title Global Qt Declarations - \ingroup classlists + \ingroup funclists - \brief The <QtGlobal> header provides basic declarations and - is included by all other Qt headers. + \brief The <QtGlobal> header file includes the fundamental global + declarations. It is included by most other Qt header files. - The declarations include \l {types}, \l functions and - \l macros. + The global declarations include \l{types}, \l{functions} and + \l{macros}. The type definitions are partly convenience definitions for basic types (some of which guarantee certain bit-sizes on all platforms diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 319e2ce..657e367 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2422,6 +2422,24 @@ */ /*! + \enum Qt::AnchorPoint + + Specifies a side of a layout item that can be anchored. This is used by + QGraphicsAnchorLayout. + + \value AnchorLeft The left side of a layout item. + \value AnchorHorizontalCenter A "virtual" side that is centered between the left and the + right side of a layout item. + \value AnchorRight The right side of a layout item. + \value AnchorTop The top side of a layout item. + \value AnchorVerticalCenter A "virtual" side that is centered between the top and the + bottom side of a layout item. + \value AnchorBottom The bottom side of a layout item. + + \sa QGraphicsAnchorLayout +*/ + +/*! \enum Qt::InputMethodHint \value ImhNone No hints. diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 65df600..a16ece1 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -174,10 +174,13 @@ static void construct(QVariant::Private *x, const void *copy) case QVariant::UserType: break; default: - x->is_shared = true; - x->data.shared = new QVariant::PrivateShared(QMetaType::construct(x->type, copy)); - if (!x->data.shared->ptr) + void *ptr = QMetaType::construct(x->type, copy); + if (!ptr) { x->type = QVariant::Invalid; + } else { + x->is_shared = true; + x->data.shared = new QVariant::PrivateShared(ptr); + } break; } x->is_null = !copy; @@ -456,15 +459,17 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b) if (!QMetaType::isRegistered(a->type)) qFatal("QVariant::compare: type %d unknown to QVariant.", a->type); + const void *a_ptr = a->is_shared ? a->data.shared->ptr : &(a->data.ptr); + const void *b_ptr = b->is_shared ? b->data.shared->ptr : &(b->data.ptr); + /* The reason we cannot place this test in a case branch above for the types * QMetaType::VoidStar, QMetaType::QObjectStar and so forth, is that it wouldn't include * user defined pointer types. */ const char *const typeName = QMetaType::typeName(a->type); if (typeName[qstrlen(typeName) - 1] == '*') - return *static_cast<void **>(a->data.shared->ptr) == - *static_cast<void **>(b->data.shared->ptr); + return *static_cast<void *const *>(a_ptr) == *static_cast<void *const *>(b_ptr); - return a->data.shared->ptr == b->data.shared->ptr; + return a_ptr == b_ptr; } /*! @@ -1371,7 +1376,7 @@ void QVariant::create(int type, const void *copy) QVariant::~QVariant() { - if (d.type > Char && d.type != QMetaType::Float && d.type != QMetaType::QObjectStar && (!d.is_shared || !d.data.shared->ref.deref())) + if ((d.is_shared && !d.data.shared->ref.deref()) || (!d.is_shared && d.type > Char && d.type < UserType)) handler->clear(&d); } @@ -1387,7 +1392,7 @@ QVariant::QVariant(const QVariant &p) { if (d.is_shared) { d.data.shared->ref.ref(); - } else if (p.d.type > Char && p.d.type != QMetaType::Float && p.d.type != QMetaType::QObjectStar) { + } else if (p.d.type > Char && p.d.type < QVariant::UserType) { handler->construct(&d, p.constData()); d.is_null = p.d.is_null; } @@ -1627,6 +1632,22 @@ QVariant::QVariant(Type type) { create(type, 0); } QVariant::QVariant(int typeOrUserType, const void *copy) { create(typeOrUserType, copy); d.is_null = false; } + +/*! \internal + flags is true if it is a pointer type + */ +QVariant::QVariant(int typeOrUserType, const void *copy, uint flags) +{ + if (flags) { //type is a pointer type + d.type = typeOrUserType; + d.data.ptr = *reinterpret_cast<void *const*>(copy); + d.is_null = false; + } else { + create(typeOrUserType, copy); + d.is_null = false; + } +} + QVariant::QVariant(int val) { d.is_null = false; d.type = Int; d.data.i = val; } QVariant::QVariant(uint val) @@ -1743,7 +1764,7 @@ QVariant& QVariant::operator=(const QVariant &variant) if (variant.d.is_shared) { variant.d.data.shared->ref.ref(); d = variant.d; - } else if (variant.d.type > Char && variant.d.type != QMetaType::Float && variant.d.type != QMetaType::QObjectStar) { + } else if (variant.d.type > Char && variant.d.type < UserType) { d.type = variant.d.type; handler->construct(&d, variant.constData()); d.is_null = variant.d.is_null; @@ -1797,7 +1818,7 @@ const char *QVariant::typeName() const */ void QVariant::clear() { - if (!d.is_shared || !d.data.shared->ref.deref()) + if ((d.is_shared && !d.data.shared->ref.deref()) || (!d.is_shared && d.type < UserType && d.type > Char)) handler->clear(&d); d.type = Invalid; d.is_null = true; diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index d6a704e..97af54b 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -174,6 +174,7 @@ class Q_CORE_EXPORT QVariant ~QVariant(); QVariant(Type type); QVariant(int typeOrUserType, const void *copy); + QVariant(int typeOrUserType, const void *copy, uint flags); QVariant(const QVariant &other); #ifndef QT_NO_DATASTREAM @@ -445,7 +446,7 @@ inline bool qvariant_cast_helper(const QVariant &v, QVariant::Type tp, void *ptr template <typename T> inline QVariant qVariantFromValue(const T &t) { - return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t); + return QVariant(qMetaTypeId<T>(reinterpret_cast<T *>(0)), &t, QTypeInfo<T>::isPointer); } template <> @@ -464,7 +465,7 @@ inline void qVariantSetValue(QVariant &v, const T &t) old->~T(); new (old) T(t); //call the copy constructor } else { - v = QVariant(type, &t); + v = QVariant(type, &t, QTypeInfo<T>::isPointer); } } diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp index e2d1f69..89dabde 100644 --- a/src/corelib/statemachine/qeventtransition.cpp +++ b/src/corelib/statemachine/qeventtransition.cpp @@ -92,7 +92,7 @@ QT_BEGIN_NAMESPACE */ /*! - \property QEventTransition::eventObject + \property QEventTransition::eventSource \brief the event source that this event transition is associated with */ @@ -205,7 +205,7 @@ void QEventTransition::setEventType(QEvent::Type type) /*! Returns the event source associated with this event transition. */ -QObject *QEventTransition::eventObject() const +QObject *QEventTransition::eventSource() const { Q_D(const QEventTransition); return d->object; @@ -215,7 +215,7 @@ QObject *QEventTransition::eventObject() const Sets the event source associated with this event transition to be the given \a object. */ -void QEventTransition::setEventObject(QObject *object) +void QEventTransition::setEventSource(QObject *object) { Q_D(QEventTransition); if (d->object == object) diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h index 6cf6a96..941bfa5 100644 --- a/src/corelib/statemachine/qeventtransition.h +++ b/src/corelib/statemachine/qeventtransition.h @@ -57,15 +57,15 @@ class QEventTransitionPrivate; class Q_CORE_EXPORT QEventTransition : public QAbstractTransition { Q_OBJECT - Q_PROPERTY(QObject* eventObject READ eventObject WRITE setEventObject) + Q_PROPERTY(QObject* eventSource READ eventSource WRITE setEventSource) Q_PROPERTY(QEvent::Type eventType READ eventType WRITE setEventType) public: QEventTransition(QState *sourceState = 0); QEventTransition(QObject *object, QEvent::Type type, QState *sourceState = 0); ~QEventTransition(); - QObject *eventObject() const; - void setEventObject(QObject *object); + QObject *eventSource() const; + void setEventSource(QObject *object); QEvent::Type eventType() const; void setEventType(QEvent::Type type); diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc index f7b7798..771c544 100644 --- a/src/corelib/tools/qalgorithms.qdoc +++ b/src/corelib/tools/qalgorithms.qdoc @@ -42,9 +42,9 @@ /*! \headerfile <QtAlgorithms> \title Generic Algorithms - \ingroup classlists + \ingroup funclists - \brief The <QtAlgorithms> header provides generic template-based algorithms. + \brief The <QtAlgorithms> header includes the generic, template-based algorithms. Qt provides a number of global template functions in \c <QtAlgorithms> that work on containers and perform well-know diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index 9d0ead1..f0df0c9 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -402,7 +402,7 @@ void QEglContext::dumpAllConfigs() QString QEglContext::extensions() { - const char* exts = eglQueryString(dpy, EGL_EXTENSIONS); + const char* exts = eglQueryString(QEglContext::defaultDisplay(0), EGL_EXTENSIONS); return QString(QLatin1String(exts)); } diff --git a/src/gui/egl/qegl_p.h b/src/gui/egl/qegl_p.h index bba5e59..97730d8 100644 --- a/src/gui/egl/qegl_p.h +++ b/src/gui/egl/qegl_p.h @@ -122,8 +122,8 @@ public: void dumpAllConfigs(); - QString extensions(); - bool hasExtension(const char* extensionName); + static QString extensions(); + static bool hasExtension(const char* extensionName); private: QEgl::API apiType; diff --git a/src/gui/egl/qeglproperties.cpp b/src/gui/egl/qeglproperties.cpp index 22b55fe..7b582c4 100644 --- a/src/gui/egl/qeglproperties.cpp +++ b/src/gui/egl/qeglproperties.cpp @@ -257,6 +257,20 @@ static void addTag(QString& str, const QString& tag) str += tag; } +void QEglProperties::dumpAllConfigs() +{ + EGLint count = 0; + eglGetConfigs(QEglContext::defaultDisplay(0), 0, 0, &count); + if (count < 1) + return; + + EGLConfig *configs = new EGLConfig [count]; + eglGetConfigs(QEglContext::defaultDisplay(0), configs, count, &count); + for (EGLint index = 0; index < count; ++index) + qWarning() << QEglProperties(configs[index]).toString(); + delete [] configs; +} + // Convert a property list to a string suitable for debug output. QString QEglProperties::toString() const { diff --git a/src/gui/egl/qeglproperties_p.h b/src/gui/egl/qeglproperties_p.h index 4ef3814..383a873 100644 --- a/src/gui/egl/qeglproperties_p.h +++ b/src/gui/egl/qeglproperties_p.h @@ -130,6 +130,8 @@ public: QString toString() const; + static void dumpAllConfigs(); + private: QVarLengthArray<int> props; }; diff --git a/src/gui/graphicsview/qgraphicsanchorlayout.cpp b/src/gui/graphicsview/qgraphicsanchorlayout.cpp index fed0e5a..3c2ea37 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout.cpp @@ -130,7 +130,8 @@ QGraphicsAnchorLayout::~QGraphicsAnchorLayout() * * The spacing can also be set manually by using setAnchorSpacing() method. * - * \sa removeAnchor, addCornerAnchors, addLeftAndRightAnchors, addTopAndBottomAnchors, addAllAnchors + * \sa removeAnchor(), addCornerAnchors(), addLeftAndRightAnchors(), addTopAndBottomAnchors(), + * addAllAnchors() */ void QGraphicsAnchorLayout::addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge) @@ -251,7 +252,7 @@ qreal QGraphicsAnchorLayout::anchorSpacing(const QGraphicsLayoutItem *firstItem, \a secondItem and \a secondEdge to be the default spacing. Depending on the anchor type, the default spacing is either 0 or a value returned from the style. - \sa setAnchorSpacing, anchorSpacing, addAnchor + \sa setAnchorSpacing(), anchorSpacing(), addAnchor() */ void QGraphicsAnchorLayout::unsetAnchorSpacing(const QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, const QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge) @@ -297,7 +298,7 @@ void QGraphicsAnchorLayout::removeAnchor(QGraphicsLayoutItem *firstItem, Qt::Anc /*! Sets the default horizontal spacing for the anchor layout to \a spacing. - \sa horizontalSpacing, setVerticalSpacing, setSpacing + \sa horizontalSpacing(), setVerticalSpacing(), setSpacing() */ void QGraphicsAnchorLayout::setHorizontalSpacing(qreal spacing) { @@ -309,7 +310,7 @@ void QGraphicsAnchorLayout::setHorizontalSpacing(qreal spacing) /*! Sets the default vertical spacing for the anchor layout to \a spacing. - \sa verticalSpacing, setHorizontalSpacing, setSpacing + \sa verticalSpacing(), setHorizontalSpacing(), setSpacing() */ void QGraphicsAnchorLayout::setVerticalSpacing(qreal spacing) { @@ -323,7 +324,7 @@ void QGraphicsAnchorLayout::setVerticalSpacing(qreal spacing) If an item is anchored with no spacing associated with the anchor, it will use the default spacing. - \sa setHorizontalSpacing, setVerticalSpacing + \sa setHorizontalSpacing(), setVerticalSpacing() */ void QGraphicsAnchorLayout::setSpacing(qreal spacing) { @@ -335,7 +336,7 @@ void QGraphicsAnchorLayout::setSpacing(qreal spacing) /*! Returns the default horizontal spacing for the anchor layout. - \sa verticalSpacing, setHorizontalSpacing + \sa verticalSpacing(), setHorizontalSpacing() */ qreal QGraphicsAnchorLayout::horizontalSpacing() const { @@ -346,7 +347,7 @@ qreal QGraphicsAnchorLayout::horizontalSpacing() const /*! Returns the default vertical spacing for the anchor layout. - \sa horizontalSpacing, setVerticalSpacing + \sa horizontalSpacing(), setVerticalSpacing() */ qreal QGraphicsAnchorLayout::verticalSpacing() const { diff --git a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp index c137de3..9a34ad5 100644 --- a/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/gui/graphicsview/qgraphicsanchorlayout_p.cpp @@ -1652,7 +1652,7 @@ QList<QSimplexConstraint *> QGraphicsAnchorLayoutPrivate::constraintsFromSizeHin } /*! - \Internal + \internal */ QList< QList<QSimplexConstraint *> > QGraphicsAnchorLayoutPrivate::getGraphParts(Orientation orientation) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 0bca8f7..e1a6e80 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -2563,6 +2563,8 @@ void QPainter::setClipRect(const QRectF &rect, Qt::ClipOperation op) QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint); d->state->clipEnabled = true; d->extended->clip(vp, op); + if (op == Qt::ReplaceClip || op == Qt::NoClip) + d->state->clipInfo.clear(); d->state->clipInfo << QPainterClipInfo(rect, op, d->state->matrix); d->state->clipOperation = op; return; @@ -2609,6 +2611,8 @@ void QPainter::setClipRect(const QRect &rect, Qt::ClipOperation op) if (d->extended) { d->state->clipEnabled = true; d->extended->clip(rect, op); + if (op == Qt::ReplaceClip || op == Qt::NoClip) + d->state->clipInfo.clear(); d->state->clipInfo << QPainterClipInfo(rect, op, d->state->matrix); d->state->clipOperation = op; return; @@ -2662,6 +2666,8 @@ void QPainter::setClipRegion(const QRegion &r, Qt::ClipOperation op) if (d->extended) { d->state->clipEnabled = true; d->extended->clip(r, op); + if (op == Qt::NoClip || op == Qt::ReplaceClip) + d->state->clipInfo.clear(); d->state->clipInfo << QPainterClipInfo(r, op, d->state->matrix); d->state->clipOperation = op; return; @@ -3066,6 +3072,8 @@ void QPainter::setClipPath(const QPainterPath &path, Qt::ClipOperation op) if (d->extended) { d->state->clipEnabled = true; d->extended->clip(path, op); + if (op == Qt::NoClip || op == Qt::ReplaceClip) + d->state->clipInfo.clear(); d->state->clipInfo << QPainterClipInfo(path, op, d->state->matrix); d->state->clipOperation = op; return; diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index f5905ec..57ef70c 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1302,7 +1302,6 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format) #if defined(QT_OPENGL_ES) eglContext = 0; #endif - pbo = 0; fbo = 0; crWin = false; initDone = false; @@ -1645,12 +1644,6 @@ QGLContext::~QGLContext() void QGLContextPrivate::cleanup() { - Q_Q(QGLContext); - if (pbo) { - QGLContext *ctx = q; - glDeleteBuffers(1, &pbo); - pbo = 0; - } } typedef QHash<QString, GLuint> QGLDDSCache; @@ -1914,14 +1907,6 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G QGLContext *ctx = q; - bool use_pbo = false; - if (QGLExtensions::glExtensions & QGLExtensions::PixelBufferObject) { - - use_pbo = qt_resolve_buffer_extensions(ctx); - if (use_pbo && pbo == 0) - glGenBuffers(1, &pbo); - } - // the GL_BGRA format is only present in GL version >= 1.2 GLenum texture_format = (QGLFormat::openGLVersionFlags() & QGLFormat::OpenGL_Version_1_2) ? GL_BGRA : GL_RGBA; @@ -1956,20 +1941,10 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G glTexParameterf(target, GL_GENERATE_MIPMAP_SGIS, GL_TRUE); #endif glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - - // Mipmap generation causes huge slowdown with PBO's for some reason - use_pbo = false; } else { glTexParameterf(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); } - uchar *ptr = 0; - if (use_pbo) { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, pbo); - glBufferData(GL_PIXEL_UNPACK_BUFFER_ARB, img.width() * img.height() * 4, 0, GL_STREAM_DRAW_ARB); - ptr = reinterpret_cast<uchar *>(glMapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, GL_WRITE_ONLY_ARB)); - } - QImage::Format target_format = img.format(); // Note: the clean param is only true when a texture is bound // from the QOpenGLPaintEngine - in that case we have to force @@ -1979,21 +1954,10 @@ QGLTexture* QGLContextPrivate::bindTexture(const QImage &image, GLenum target, G if (img.format() != target_format) img = img.convertToFormat(target_format); - if (ptr) { - QImage buffer(ptr, img.width(), img.height(), target_format); - convertToGLFormatHelper(buffer, img, texture_format); - glUnmapBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB); - glTexImage2D(target, 0, format, img.width(), img.height(), 0, texture_format, - GL_UNSIGNED_BYTE, 0); - } else { - QImage tx(scale ? QSize(tx_w, tx_h) : img.size(), target_format); - convertToGLFormatHelper(tx, img, texture_format); - glTexImage2D(target, 0, format, tx.width(), tx.height(), 0, texture_format, - GL_UNSIGNED_BYTE, tx.bits()); - } - - if (use_pbo) - glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, 0); + QImage tx(scale ? QSize(tx_w, tx_h) : img.size(), target_format); + convertToGLFormatHelper(tx, img, texture_format); + glTexImage2D(target, 0, format, tx.width(), tx.height(), 0, texture_format, + GL_UNSIGNED_BYTE, tx.bits()); // this assumes the size of a texture is always smaller than the max cache size int cost = img.width()*img.height()*4/1024; @@ -3408,12 +3372,15 @@ bool QGLWidget::event(QEvent *e) setContext(new QGLContext(d->glcx->requestedFormat(), this)); // ### recreating the overlay isn't supported atm } + } + #if defined(QT_OPENGL_ES) - // The window may have been re-created during re-parent - if so, the EGL + if ((e->type() == QEvent::ParentChange) || (e->type() == QEvent::WindowStateChange)) { + // The window may have been re-created during re-parent or state change - if so, the EGL // surface will need to be re-created. d->recreateEglSurface(false); -#endif } +#endif #elif defined(Q_WS_WIN) if (e->type() == QEvent::ParentChange) { QGLContext *newContext = new QGLContext(d->glcx->requestedFormat(), this); diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index 92aea6c..ab040ed 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -252,7 +252,6 @@ public: #endif QGLFormat glFormat; QGLFormat reqFormat; - GLuint pbo; GLuint fbo; uint valid : 1; diff --git a/src/script/script.pro b/src/script/script.pro index f67c698..5844620 100644 --- a/src/script/script.pro +++ b/src/script/script.pro @@ -37,6 +37,15 @@ wince* { LIBS += -lmmtimer } +# avoid warnings when parsing JavaScriptCore.pri +# (we don't care about generating files, we already have them generated) +defineTest(addExtraCompiler) { + return(true) +} +defineTest(addExtraCompilerWithHeader) { + return(true) +} + include($$WEBKITDIR/JavaScriptCore/JavaScriptCore.pri) INCLUDEPATH += $$WEBKITDIR/JavaScriptCore |