diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-02 05:45:12 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-02 05:45:12 (GMT) |
commit | 12377c11120fd49ee2c29fd5026572298f4570ad (patch) | |
tree | 0a8d0d0083a182bed9d71565a5d669462d0510d2 /src | |
parent | 02d3230a6b569e848bdae30ac2184613aade64ff (diff) | |
parent | 759fe35812975104f3b73934d7d179159ce9effa (diff) | |
download | Qt-12377c11120fd49ee2c29fd5026572298f4570ad.zip Qt-12377c11120fd49ee2c29fd5026572298f4570ad.tar.gz Qt-12377c11120fd49ee2c29fd5026572298f4570ad.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fix tst_QPainter::drawImage_task258776
Fix the rendering of lines with the X11 paint engine
Fix the byte order in QImage::fill for 24bpp formats
QScript: remove JSC::JSLock
QScript: document/obsolete things that does not work since the move to JSC
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qimage.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_x11.cpp | 22 | ||||
-rw-r--r-- | src/script/api/qscriptcontext.cpp | 10 | ||||
-rw-r--r-- | src/script/api/qscriptcontextinfo.cpp | 11 | ||||
-rw-r--r-- | src/script/api/qscriptcontextinfo.h | 4 | ||||
-rw-r--r-- | src/script/api/qscriptengine.cpp | 15 | ||||
-rw-r--r-- | src/script/api/qscriptengineagent.cpp | 7 |
7 files changed, 34 insertions, 37 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 30cf758..52ba2b9 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2010,7 +2010,7 @@ void QImage::fill(uint pixel) 0, 0, d->width, d->height, d->bytes_per_line); return; } else if (d->depth == 24) { - qt_rectfill<quint24>(reinterpret_cast<quint24*>(d->data), pixel, + qt_rectfill<qrgb888>(reinterpret_cast<qrgb888*>(d->data), pixel, 0, 0, d->width, d->height, d->bytes_per_line); return; } diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp index 910b2df..e521e01 100644 --- a/src/gui/painting/qpaintengine_x11.cpp +++ b/src/gui/painting/qpaintengine_x11.cpp @@ -696,11 +696,10 @@ void QX11PaintEngine::drawLines(const QLine *lines, int lineCount) linef = d->matrix.map(QLineF(lines[i])); } if (clipLine(&linef, d->polygonClipper.boundingRect())) { - int x1 = qRound(linef.x1() + aliasedCoordinateDelta); - int y1 = qRound(linef.y1() + aliasedCoordinateDelta); - int x2 = qRound(linef.x2() + aliasedCoordinateDelta); - int y2 = qRound(linef.y2() + aliasedCoordinateDelta); - + int x1 = qFloor(linef.x1() + aliasedCoordinateDelta); + int y1 = qFloor(linef.y1() + aliasedCoordinateDelta); + int x2 = qFloor(linef.x2() + aliasedCoordinateDelta); + int y2 = qFloor(linef.y2() + aliasedCoordinateDelta); XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2); } } @@ -730,11 +729,10 @@ void QX11PaintEngine::drawLines(const QLineF *lines, int lineCount) for (int i = 0; i < lineCount; ++i) { QLineF linef = d->matrix.map(lines[i]); if (clipLine(&linef, d->polygonClipper.boundingRect())) { - int x1 = qRound(linef.x1() + aliasedCoordinateDelta); - int y1 = qRound(linef.y1() + aliasedCoordinateDelta); - int x2 = qRound(linef.x2() + aliasedCoordinateDelta); - int y2 = qRound(linef.y2() + aliasedCoordinateDelta); - + int x1 = qFloor(linef.x1() + aliasedCoordinateDelta); + int y1 = qFloor(linef.y1() + aliasedCoordinateDelta); + int x2 = qFloor(linef.x2() + aliasedCoordinateDelta); + int y2 = qFloor(linef.y2() + aliasedCoordinateDelta); XDrawLine(d->dpy, d->hd, d->gc, x1, y1, x2, y2); } } @@ -1690,8 +1688,8 @@ void QX11PaintEnginePrivate::strokePolygon_dev(const QPointF *polygonPoints, int if (clippedCount > 0) { QVarLengthArray<XPoint> xpoints(clippedCount); for (int i = 0; i < clippedCount; ++i) { - xpoints[i].x = qRound(clippedPoints[i].x + aliasedCoordinateDelta); - xpoints[i].y = qRound(clippedPoints[i].y + aliasedCoordinateDelta); + xpoints[i].x = qFloor(clippedPoints[i].x + aliasedCoordinateDelta); + xpoints[i].y = qFloor(clippedPoints[i].y + aliasedCoordinateDelta); } uint numberPoints = qMin(clippedCount, xlibMaxLinePoints); XPoint *pts = xpoints.data(); diff --git a/src/script/api/qscriptcontext.cpp b/src/script/api/qscriptcontext.cpp index 3f08e74..1a11100 100644 --- a/src/script/api/qscriptcontext.cpp +++ b/src/script/api/qscriptcontext.cpp @@ -323,6 +323,9 @@ QScriptValue QScriptContext::argumentsObject() const When a function is called as constructor, the thisObject() contains the newly constructed object to be initialized. + + \note This function is only guarenteed to work for a context + corresponding to native functions. */ bool QScriptContext::isCalledAsConstructor() const { @@ -413,6 +416,9 @@ void QScriptContext::setReturnValue(const QScriptValue &result) object provides access to the local variables associated with this context. + \note The activation object might not be available if there is no + active QScriptEngineAgent, as it might be optimized. + \sa argument(), argumentsObject() */ @@ -472,6 +478,10 @@ QScriptValue QScriptContext::activationObject() const activation. If \a activation is not an object, this function does nothing. + + \note For a context corresponding to a JavaScript function, this is only + guarenteed to work if there was an QScriptEngineAgent active on the + engine while the function was evaluated. */ void QScriptContext::setActivationObject(const QScriptValue &activation) { diff --git a/src/script/api/qscriptcontextinfo.cpp b/src/script/api/qscriptcontextinfo.cpp index ebb1770..a90e014 100644 --- a/src/script/api/qscriptcontextinfo.cpp +++ b/src/script/api/qscriptcontextinfo.cpp @@ -53,8 +53,7 @@ QT_BEGIN_NAMESPACE current statement. If the called function is executing Qt Script code, you can obtain - the script location with the functions fileName(), lineNumber() and - columnNumber(). + the script location with the functions fileName() and lineNumber(). You can obtain the starting line number and ending line number of a Qt Script function definition with functionStartLineNumber() and @@ -317,13 +316,7 @@ int QScriptContextInfo::lineNumber() const } /*! - Returns the column number corresponding to the statement being - executed, or -1 if the column number is not available. - - The column number is only available if Qt Script code is being - executed. - - \sa lineNumber(), fileName() + \obsolete */ int QScriptContextInfo::columnNumber() const { diff --git a/src/script/api/qscriptcontextinfo.h b/src/script/api/qscriptcontextinfo.h index d0b3f21..64a1e15 100644 --- a/src/script/api/qscriptcontextinfo.h +++ b/src/script/api/qscriptcontextinfo.h @@ -69,7 +69,9 @@ public: qint64 scriptId() const; QString fileName() const; int lineNumber() const; - int columnNumber() const; +#ifdef QT_DEPRECATED + QT_DEPRECATED int columnNumber() const; +#endif QString functionName() const; FunctionType functionType() const; diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 26673f4..8560214 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -44,7 +44,6 @@ #include "CodeBlock.h" #include "Error.h" -#include "JSLock.h" #include "Interpreter.h" #include "PrototypeFunction.h" @@ -152,8 +151,7 @@ QT_BEGIN_NAMESPACE evaluation caused an exception by calling hasUncaughtException(). In that case, you can call toString() on the error object to obtain an error message. The current uncaught exception is also available - through uncaughtException(). You can obtain a human-readable - backtrace of the exception with uncaughtExceptionBacktrace(). + through uncaughtException(). Calling clearExceptions() will cause any uncaught exceptions to be cleared. @@ -1003,7 +1001,6 @@ QScriptEnginePrivate::~QScriptEnginePrivate() detachAllRegisteredScriptStrings(); qDeleteAll(m_qobjectData); qDeleteAll(m_typeInfos); - JSC::JSLock lock(false); globalData->heap.destroy(); globalData->deref(); while (freeScriptValues) { @@ -1292,7 +1289,6 @@ bool QScriptEnginePrivate::isCollecting() const void QScriptEnginePrivate::collectGarbage() { - JSC::JSLock lock(false); QScript::APIShim shim(this); globalData->heap.collectAllGarbage(); } @@ -1322,7 +1318,6 @@ JSC::JSValue QScriptEnginePrivate::evaluateHelper(JSC::ExecState *exec, intptr_t bool &compile) { Q_Q(QScriptEngine); - JSC::JSLock lock(false); // ### hmmm QBoolBlocker inEvalBlocker(inEval, true); q->currentContext()->activationObject(); //force the creation of a context for native function; @@ -2800,8 +2795,7 @@ void QScriptEnginePrivate::popContext() The exception state is cleared when evaluate() is called. - \sa uncaughtException(), uncaughtExceptionLineNumber(), - uncaughtExceptionBacktrace() + \sa uncaughtException(), uncaughtExceptionLineNumber() */ bool QScriptEngine::hasUncaughtException() const { @@ -2819,7 +2813,6 @@ bool QScriptEngine::hasUncaughtException() const message. \sa hasUncaughtException(), uncaughtExceptionLineNumber(), - uncaughtExceptionBacktrace() */ QScriptValue QScriptEngine::uncaughtException() const { @@ -2839,7 +2832,7 @@ QScriptValue QScriptEngine::uncaughtException() const Line numbers are 1-based, unless a different base was specified as the second argument to evaluate(). - \sa hasUncaughtException(), uncaughtExceptionBacktrace() + \sa hasUncaughtException() */ int QScriptEngine::uncaughtExceptionLineNumber() const { @@ -2851,7 +2844,7 @@ int QScriptEngine::uncaughtExceptionLineNumber() const /*! Returns a human-readable backtrace of the last uncaught exception. - Each line is of the form \c{<function-name>(<arguments>)@<file-name>:<line-number>}. + It is in the form \c{<function-name>()@<file-name>:<line-number>}. \sa uncaughtException() */ diff --git a/src/script/api/qscriptengineagent.cpp b/src/script/api/qscriptengineagent.cpp index c3d1566..b1f131e 100644 --- a/src/script/api/qscriptengineagent.cpp +++ b/src/script/api/qscriptengineagent.cpp @@ -372,9 +372,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId, /*! This function is called when the engine is about to execute a new statement in the script identified by \a scriptId. The statement - begins on the line and column specified by \a lineNumber and \a - columnNumber. This event is not generated for native Qt Script - functions. + begins on the line and column specified by \a lineNumber + This event is not generated for native Qt Script functions. Reimplement this function to handle this event. For example, a debugger implementation could reimplement this function to provide @@ -383,6 +382,8 @@ void QScriptEngineAgent::functionExit(qint64 scriptId, The default implementation does nothing. + \note \a columnNumber is undefined + \sa scriptLoad(), functionEntry() */ void QScriptEngineAgent::positionChange(qint64 scriptId, |