summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h3
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h3
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp4
-rw-r--r--src/opengl/qgl.cpp17
-rw-r--r--src/opengl/qglpixmapfilter.cpp16
-rw-r--r--src/opengl/qwindowsurface_gl.cpp75
-rw-r--r--src/testlib/qtestcase.cpp6
7 files changed, 113 insertions, 11 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]);
}
}