diff options
author | Jason McDonald <jason.mcdonald@nokia.com> | 2009-09-28 09:36:10 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-09-28 09:36:10 (GMT) |
commit | 91f5404cdbe7cdf0521a257d6abf662b86c31986 (patch) | |
tree | e729804589da176c6f6b25f62acb93c25e56c12f | |
parent | b4a9925dfd3298bae65887dbad767c4a2211310c (diff) | |
parent | a49ca92bc343e58ec21dd52a933b23f43ecfc0a6 (diff) | |
download | Qt-91f5404cdbe7cdf0521a257d6abf662b86c31986.zip Qt-91f5404cdbe7cdf0521a257d6abf662b86c31986.tar.gz Qt-91f5404cdbe7cdf0521a257d6abf662b86c31986.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r-- | src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h | 3 | ||||
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 3 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 4 | ||||
-rw-r--r-- | src/opengl/qgl.cpp | 17 | ||||
-rw-r--r-- | src/opengl/qglpixmapfilter.cpp | 16 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 75 | ||||
-rw-r--r-- | src/testlib/qtestcase.cpp | 6 | ||||
-rw-r--r-- | tests/auto/qeasingcurve/tst_qeasingcurve.cpp | 12 | ||||
-rw-r--r-- | tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp | 8 | ||||
-rw-r--r-- | tests/auto/qimagereader/tst_qimagereader.cpp | 4 | ||||
-rw-r--r-- | tests/auto/qprocess/qprocess.pro | 1 | ||||
-rw-r--r-- | tests/auto/qsqlquery/tst_qsqlquery.cpp | 4 |
12 files changed, 122 insertions, 31 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h index cc40336..39cafab 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h @@ -257,7 +257,8 @@ #define WTF_PLATFORM_MIDDLE_ENDIAN 1 #endif #define ARM_ARCH_VERSION 3 -#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) +#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(ARMV4I) \ + || defined(_ARMV4I_) || defined(armv4i) #undef ARM_ARCH_VERSION #define ARM_ARCH_VERSION 4 #endif diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h index e508f77..bd82d8f 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h @@ -238,7 +238,8 @@ #define WTF_PLATFORM_MIDDLE_ENDIAN 1 #endif #define ARM_ARCH_VERSION 3 -#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) +#if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) || defined(ARMV4I) \ + || defined(_ARMV4I_) || defined(armv4i) #undef ARM_ARCH_VERSION #define ARM_ARCH_VERSION 4 #endif diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index b8a5711..119c89d 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -758,6 +758,8 @@ void QGL2PaintEngineEx::beginNativePainting() glMatrixMode(GL_MODELVIEW); glLoadMatrixf(&mv_matrix[0][0]); +#else + Q_UNUSED(ctx); #endif d->lastTexture = GLuint(-1); @@ -1207,7 +1209,9 @@ void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const ensureActive(); d->transferMode(ImageDrawingMode); +#ifndef QT_OPENGL_ES_2 QGLContext *ctx = d->ctx; +#endif glActiveTexture(GL_TEXTURE0 + QT_IMAGE_TEXTURE_UNIT); glBindTexture(GL_TEXTURE_2D, textureId); diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 89bd7d4..97a4a73 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2514,6 +2514,8 @@ void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexT array[7] = f2vt(y2); } +#if !defined(QT_OPENGL_ES_2) + static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint textureHeight, GLenum textureTarget) { q_vertexType tx = f2vt(1); @@ -2542,7 +2544,6 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex q_vertexType vertexArray[4*2]; qt_add_rect_to_array(target, vertexArray); -#if !defined(QT_OPENGL_ES_2) glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); @@ -2552,18 +2553,22 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); -#endif } +#endif // !QT_OPENGL_ES_2 + /*! \since 4.4 Draws the given texture, \a textureId, to the given target rectangle, \a target, in OpenGL model space. The \a textureTarget should be a 2D texture target. + + \note This function is not supported under OpenGL/ES 2.0. */ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget) { +#ifndef QT_OPENGL_ES_2 #ifdef QT_OPENGL_ES if (textureTarget != GL_TEXTURE_2D) { qWarning("QGLContext::drawTexture(): texture target must be GL_TEXTURE_2D on OpenGL ES"); @@ -2587,6 +2592,12 @@ void QGLContext::drawTexture(const QRectF &target, GLuint textureId, GLenum text glDisable(textureTarget); glBindTexture(textureTarget, oldTexture); #endif +#else + Q_UNUSED(target); + Q_UNUSED(textureId); + Q_UNUSED(textureTarget); + qWarning("drawTexture(const QRectF &target, GLuint textureId, GLenum textureTarget) not supported with OpenGL ES/2.0"); +#endif } #ifdef Q_MAC_COMPAT_GL_FUNCTIONS @@ -2602,6 +2613,8 @@ void QGLContext::drawTexture(const QRectF &target, QMacCompatGLuint textureId, Q Draws the given texture at the given \a point in OpenGL model space. The \a textureTarget should be a 2D texture target. + + \note This function is not supported under OpenGL/ES. */ void QGLContext::drawTexture(const QPointF &point, GLuint textureId, GLenum textureTarget) { diff --git a/src/opengl/qglpixmapfilter.cpp b/src/opengl/qglpixmapfilter.cpp index bb0306c..bb3cb5d 100644 --- a/src/opengl/qglpixmapfilter.cpp +++ b/src/opengl/qglpixmapfilter.cpp @@ -79,6 +79,8 @@ protected: bool processGL(QPainter *painter, const QPointF &pos, const QPixmap &pixmap, const QRectF &srcRect) const; }; +#ifndef QT_OPENGL_ES_2 + class QGLPixmapConvolutionFilter: public QGLPixmapFilter<QPixmapConvolutionFilter> { public: @@ -99,6 +101,8 @@ private: mutable int m_kernelHeight; }; +#endif + class QGLPixmapBlurFilter : public QGLCustomShaderStage, public QGLPixmapFilter<QPixmapBlurFilter> { public: @@ -143,22 +147,25 @@ QPixmapFilter *QGL2PaintEngineEx::pixmapFilter(int type, const QPixmapFilter *pr return d->blurFilter.data(); } +#ifndef QT_OPENGL_ES_2 case QPixmapFilter::ConvolutionFilter: if (!d->convolutionFilter) d->convolutionFilter.reset(new QGLPixmapConvolutionFilter); return d->convolutionFilter.data(); +#endif default: break; } return QPaintEngineEx::pixmapFilter(type, prototype); } +#ifndef QT_OPENGL_ES_2 // XXX: needs to be ported + extern void qt_add_rect_to_array(const QRectF &r, q_vertexType *array); extern void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array); static void qgl_drawTexture(const QRectF &rect, int tx_width, int tx_height, const QRectF & src) { -#ifndef QT_OPENGL_ES_2 // XXX: needs to be ported #ifndef QT_OPENGL_ES glPushAttrib(GL_CURRENT_BIT); #endif @@ -187,9 +194,10 @@ static void qgl_drawTexture(const QRectF &rect, int tx_width, int tx_height, con #ifndef QT_OPENGL_ES glPopAttrib(); #endif -#endif } +#endif // !QT_OPENGL_ES_2 + static const char *qt_gl_colorize_filter = "uniform lowp vec4 colorizeColor;" "uniform lowp float colorizeStrength;" @@ -223,6 +231,8 @@ void QGLPixmapColorizeFilter::setUniforms(QGLShaderProgram *program) program->setUniformValue("colorizeStrength", float(strength())); } +#ifndef QT_OPENGL_ES_2 + // generates convolution filter code for arbitrary sized kernel QByteArray QGLPixmapConvolutionFilter::generateConvolutionShader() const { QByteArray code; @@ -315,6 +325,8 @@ bool QGLPixmapConvolutionFilter::processGL(QPainter *, const QPointF &pos, const return true; } +#endif // !QT_OPENGL_ES_2 + static const char *qt_gl_blur_filter_fast = "const int samples = 9;" "uniform mediump vec2 delta;" diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index cddc53f..3a348bc 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -86,6 +86,10 @@ #include "qgl_cl_p.h" #endif +#ifdef QT_OPENGL_ES +#include <private/qegl_p.h> +#endif + QT_BEGIN_NAMESPACE // @@ -326,6 +330,10 @@ QGLWindowSurface::~QGLWindowSurface() void QGLWindowSurface::deleted(QObject *object) { + // Make sure that the fbo is destroyed before destroying its context. + delete d_ptr->fbo; + d_ptr->fbo = 0; + QWidget *widget = qobject_cast<QWidget *>(object); if (widget) { QWidgetPrivate *widgetPrivate = widget->d_func(); @@ -352,6 +360,17 @@ void QGLWindowSurface::hijackWindow(QWidget *widget) QGLContext *ctx = new QGLContext(surfaceFormat, widget); ctx->create(qt_gl_share_widget()->context()); +#if defined(Q_WS_X11) && defined(QT_OPENGL_ES) + // Create the EGL surface to draw into. QGLContext::chooseContext() + // does not do this for X11/EGL, but does do it for other platforms. + // This probably belongs in qgl_x11egl.cpp. + QGLContextPrivate *ctxpriv = ctx->d_func(); + ctxpriv->eglSurface = ctxpriv->eglContext->createSurface(widget); + if (ctxpriv->eglSurface == EGL_NO_SURFACE) { + qWarning() << "hijackWindow() could not create EGL surface"; + } +#endif + widgetPrivate->extraData()->glContext = ctx; union { QGLContext **ctxPtr; void **voidPtr; }; @@ -584,6 +603,44 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & if (d_ptr->fbo) d_ptr->fbo->bind(); } +#else + // OpenGL/ES 2.0 version of the fbo blit. + else if (d_ptr->fbo) { + Q_UNUSED(target); + + GLuint texture = d_ptr->fbo->texture(); + + glDisable(GL_DEPTH_TEST); + + if (d_ptr->fbo->isBound()) + d_ptr->fbo->release(); + + glViewport(0, 0, size.width(), size.height()); + + QGLShaderProgram *blitProgram = + QGLEngineSharedShaders::shadersForContext(ctx)->blitProgram(); + blitProgram->enable(); + blitProgram->setUniformValue("imageTexture", 0 /*QT_IMAGE_TEXTURE_UNIT*/); + + // The shader manager's blit program does not multiply the + // vertices by the pmv matrix, so we need to do the effect + // of the orthographic projection here ourselves. + QRectF r; + qreal w = size.width() ? size.width() : 1.0f; + qreal h = size.height() ? size.height() : 1.0f; + r.setLeft((rect.left() / w) * 2.0f - 1.0f); + if (rect.right() == (size.width() - 1)) + r.setRight(1.0f); + else + r.setRight((rect.right() / w) * 2.0f - 1.0f); + r.setBottom((rect.top() / h) * 2.0f - 1.0f); + if (rect.bottom() == (size.height() - 1)) + r.setTop(1.0f); + else + r.setTop((rect.bottom() / w) * 2.0f - 1.0f); + + drawTexture(r, texture, window()->size(), br); + } #endif if (ctx->format().doubleBuffer()) @@ -635,9 +692,6 @@ void QGLWindowSurface::updateGeometry() { if (d_ptr->destructive_swap_buffers && (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject) -#ifdef QT_OPENGL_ES_2 - && (QGLExtensions::glExtensions & QGLExtensions::FramebufferBlit) -#endif && (d_ptr->fbo || !d_ptr->tried_fbo) && qt_gl_preferGL2Engine()) { @@ -805,10 +859,23 @@ static void drawTexture(const QRectF &rect, GLuint tex_id, const QSize &texSize, glDrawArrays(GL_TRIANGLE_FAN, 0, 4); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); -#endif glDisable(target); glBindTexture(target, 0); +#else + glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexArray); + glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, texCoordArray); + + glBindTexture(target, tex_id); + + glEnableVertexAttribArray(QT_VERTEX_COORDS_ATTR); + glEnableVertexAttribArray(QT_TEXTURE_COORDS_ATTR); + glDrawArrays(GL_TRIANGLE_FAN, 0, 4); + glDisableVertexAttribArray(QT_VERTEX_COORDS_ATTR); + glDisableVertexAttribArray(QT_TEXTURE_COORDS_ATTR); + + glBindTexture(target, 0); +#endif } QImage *QGLWindowSurface::buffer(const QWidget *widget) diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 3392ed7..7e7bcd1 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -1517,10 +1517,14 @@ FatalSignalHandler::FatalSignalHandler() for (int i = 0; fatalSignals[i]; ++i) { sigaction(fatalSignals[i], &act, &oldact); +#ifndef Q_WS_QWS // Don't overwrite any non-default handlers + // however, we need to replace the default QWS handlers if (oldact.sa_flags & SA_SIGINFO || oldact.sa_handler != SIG_DFL) { sigaction(fatalSignals[i], &oldact, 0); - } else { + } else +#endif + { sigaddset(&handledSignals, fatalSignals[i]); } } diff --git a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp index 8e0d37d..8cf686e 100644 --- a/tests/auto/qeasingcurve/tst_qeasingcurve.cpp +++ b/tests/auto/qeasingcurve/tst_qeasingcurve.cpp @@ -417,18 +417,18 @@ void tst_QEasingCurve::valueForProgress() // the least significant digit it is still subject to rounding errors qreal error = easeConv - ex; -#ifdef Q_OS_WINCE + qreal errorbound = 0.00001; +#if defined( Q_OS_WINCE ) || defined( Q_OS_SYMBIAN ) // exception values for WINCE(this test should be rewritten, as it only freezes the status quo of QEasingCurve // The failing (2) values are explicitly excepted here: // The source values for the comparison table should remain untruncated double and the // error bound checking function dynamic. Also the source values should come from a "trusted" source and not // from QEasingCurve itself. - qreal errorbound = 0.00001; if ((type == int(QEasingCurve::InOutBounce) && (i == 8 || i == 6) ) || (type == int(QEasingCurve::OutExpo) && i == 2)) - errorbound = 0.0002; -#endif // accept the potential rounding error in the least significant digit - - QVERIFY(error <= errorbound ); + errorbound = 0.0002; +#endif + // accept the potential rounding error in the least significant digit + QVERIFY(error <= errorbound ); } #endif } diff --git a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp index 88bf229..7735f30 100644 --- a/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp +++ b/tests/auto/qfilesystemwatcher/tst_qfilesystemwatcher.cpp @@ -318,9 +318,6 @@ void tst_QFileSystemWatcher::watchDirectory() #ifdef Q_OS_WINCE QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort); -#elif defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) - // Since native watcher is always used in real devices, this poller issue is irrelevant - QEXPECT_FAIL("poller", "Poller doesn't detect directory removal in RVCT builds", Abort); #endif QCOMPARE(changedSpy.count(), 2); QCOMPARE(changedSpy.at(0).count(), 1); @@ -490,11 +487,6 @@ void tst_QFileSystemWatcher::watchFileAndItsDirectory() #ifdef Q_OS_WINCE QEXPECT_FAIL("poller", "Directory does not get updated on file removal(See #137910)", Abort); #endif -#if defined(Q_OS_SYMBIAN) && defined(Q_CC_RVCT) - // Since native watcher is always used in real devices, this poller issue is irrelevant - // Symbian file system does not change modification time on a directory when a file inside is changed - QEXPECT_FAIL("poller", "Poller doesn't detect directory changes in RVCT builds", Abort); -#endif QCOMPARE(dirChangedSpy.count(), 1); dirChangedSpy.clear(); diff --git a/tests/auto/qimagereader/tst_qimagereader.cpp b/tests/auto/qimagereader/tst_qimagereader.cpp index c0d5051..05b506c 100644 --- a/tests/auto/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/qimagereader/tst_qimagereader.cpp @@ -816,9 +816,7 @@ void tst_QImageReader::readFromDevice() { QFETCH(QString, fileName); QFETCH(QByteArray, format); - #ifdef Q_OS_SYMBIAN - QSKIP("Symbian local sockets are not working", SkipAll); - #endif + QImage expectedImage(prefix + fileName, format); QFile file(prefix + fileName); diff --git a/tests/auto/qprocess/qprocess.pro b/tests/auto/qprocess/qprocess.pro index 892686d..77cfc82 100644 --- a/tests/auto/qprocess/qprocess.pro +++ b/tests/auto/qprocess/qprocess.pro @@ -1,7 +1,6 @@ TEMPLATE = subdirs SUBDIRS = \ - testBatFiles \ testProcessCrash \ testProcessEcho \ testProcessEcho2 \ diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp index eb95d611c..5ed9cfa 100644 --- a/tests/auto/qsqlquery/tst_qsqlquery.cpp +++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp @@ -2352,7 +2352,7 @@ void tst_QSqlQuery::sqlite_finish() QString tableName = qTableName( "qtest_lockedtable" ); QSqlQuery q( db ); - tst_Databases::safeDropTable( db2, tableName ); + tst_Databases::safeDropTable( db, tableName ); q.exec( "CREATE TABLE " + tableName + " (pk_id INTEGER PRIMARY KEY, whatever TEXT)" ); q.exec( "INSERT INTO " + tableName + " values(1, 'whatever')" ); q.exec( "INSERT INTO " + tableName + " values(2, 'whatever more')" ); @@ -2371,7 +2371,7 @@ void tst_QSqlQuery::sqlite_finish() QVERIFY_SQL( q2, exec( "DELETE FROM " + tableName + " WHERE pk_id=2" ) ); QCOMPARE( q2.numRowsAffected(), 1 ); - tst_Databases::safeDropTable( db2, tableName ); + tst_Databases::safeDropTable( db, tableName ); } QSqlDatabase::removeDatabase( "sqlite_finish_sqlite" ); |