summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp3
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp5
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h2
-rw-r--r--src/opengl/qglframebufferobject.cpp4
-rw-r--r--src/opengl/qpaintengine_opengl.cpp48
-rw-r--r--src/opengl/qpaintengine_opengl_p.h3
-rw-r--r--tests/auto/q3popupmenu/tst_q3popupmenu.cpp10
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp4
-rw-r--r--tests/auto/qwswindowsystem/tst_qwswindowsystem.cpp1
9 files changed, 53 insertions, 27 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
index 3af4a29877..c538eb1ed4 100644
--- a/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/interpreter/Interpreter.cpp
@@ -586,13 +586,14 @@ NEVER_INLINE HandlerInfo* Interpreter::throwException(CallFrame*& callFrame, JSV
unsigned bytecodeOffsetTemp = bytecodeOffset;
CodeBlock *codeBlockTemp = codeBlock;
while (!(handler = codeBlockTemp->handlerForBytecodeOffset(bytecodeOffsetTemp))) {
+ void* returnPC = callFrameTemp->returnPC();
callFrameTemp = callFrameTemp->callerFrame();
if (callFrameTemp->hasHostCallFrameFlag()) {
hasHandler = false;
break;
} else {
codeBlockTemp = callFrameTemp->codeBlock();
- bytecodeOffsetTemp = bytecodeOffsetForPC(callFrameTemp, codeBlockTemp, callFrameTemp->returnPC());
+ bytecodeOffsetTemp = bytecodeOffsetForPC(callFrameTemp, codeBlockTemp, returnPC);
}
}
if (debugger)
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 78d184f749..c87941be93 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -423,8 +423,9 @@ void QGL2PaintEngineExPrivate::updateBrushTexture()
const QPixmap& texPixmap = currentBrush->texture();
glActiveTexture(GL_TEXTURE0 + QT_BRUSH_TEXTURE_UNIT);
- ctx->d_func()->bindTexture(texPixmap, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
+ QGLTexture *tex = ctx->d_func()->bindTexture(texPixmap, GL_TEXTURE_2D, GL_RGBA, QGLContext::InternalBindOption);
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, q->state()->renderHints & QPainter::SmoothPixmapTransform);
+ textureInvertedY = tex->options & QGLContext::InvertedYBindOption ? -1 : 1;
}
brushTextureDirty = false;
}
@@ -517,7 +518,7 @@ void QGL2PaintEngineExPrivate::updateBrushUniforms()
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::PatternColor), col);
}
- QSizeF invertedTextureSize( 1.0 / texPixmap.width(), 1.0 / texPixmap.height() );
+ QSizeF invertedTextureSize(1.0 / texPixmap.width(), 1.0 * textureInvertedY / texPixmap.height());
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::InvertedTextureSize), invertedTextureSize);
QVector2D halfViewportSize(width*0.5, height*0.5);
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index da16e4729c..34f4eb8b32 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -262,6 +262,8 @@ public:
bool needsSync;
bool inRenderText;
+
+ float textureInvertedY;
};
QT_END_NAMESPACE
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index f14fa4d788..094f675c56 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -382,7 +382,6 @@ void QGLFramebufferObjectPrivate::init(QGLFramebufferObject *q, const QSize &sz,
{
QGLContext *currentContext = const_cast<QGLContext *>(QGLContext::currentContext());
ctx = QGLContextPrivate::contextGroup(currentContext);
- glDevice.setFBO(q);
bool ext_detected = (QGLExtensions::glExtensions & QGLExtensions::FramebufferObject);
if (!ext_detected || (ext_detected && !qt_resolve_framebufferobject_extensions(currentContext)))
@@ -644,7 +643,6 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, GLenum target)
: d_ptr(new QGLFramebufferObjectPrivate)
{
Q_D(QGLFramebufferObject);
- d->glDevice.setFBO(this);
d->init(this, size, NoAttachment, target, DEFAULT_FORMAT);
}
@@ -654,7 +652,7 @@ QGLFramebufferObject::QGLFramebufferObject(const QSize &size, QMacCompatGLenum t
: d_ptr(new QGLFramebufferObjectPrivate)
{
Q_D(QGLFramebufferObject);
- d->init(size, NoAttachment, target, DEFAULT_FORMAT);
+ d->init(this, size, NoAttachment, target, DEFAULT_FORMAT);
}
#endif
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index f1169fd335..15cfcfcdb3 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4300,8 +4300,10 @@ void QOpenGLPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QR
else {
GLenum target = qt_gl_preferredTextureTarget();
d->flushDrawQueue();
- d->device->context()->bindTexture(pm, target);
- drawTextureRect(pm.width(), pm.height(), r, sr, target);
+ QGLTexture *tex =
+ d->device->context()->d_func()->bindTexture(pm, target, GL_RGBA,
+ QGLContext::InternalBindOption);
+ drawTextureRect(pm.width(), pm.height(), r, sr, target, tex);
}
}
@@ -4333,10 +4335,13 @@ void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con
} else {
d->flushDrawQueue();
+ QGLTexture *tex;
if (scaled.isNull())
- d->device->context()->bindTexture(pm);
+ tex = d->device->context()->d_func()->bindTexture(pm, GL_TEXTURE_2D, GL_RGBA,
+ QGLContext::InternalBindOption);
else
- d->device->context()->bindTexture(scaled);
+ tex = d->device->context()->d_func()->bindTexture(scaled, GL_TEXTURE_2D, GL_RGBA,
+ QGLContext::InternalBindOption);
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, d->use_smooth_pixmap_transform);
#ifndef QT_OPENGL_ES
@@ -4349,6 +4354,15 @@ void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con
GLdouble tc_w = r.width()/pm.width();
GLdouble tc_h = r.height()/pm.height();
+ // Rotate the texture so that it is aligned correctly and the
+ // wrapping is done correctly
+ if (tex->options & QGLContext::InvertedYBindOption) {
+ glMatrixMode(GL_TEXTURE);
+ glPushMatrix();
+ glRotatef(180.0, 0.0, 1.0, 0.0);
+ glRotatef(180.0, 0.0, 0.0, 1.0);
+ }
+
q_vertexType vertexArray[4*2];
q_vertexType texCoordArray[4*2];
@@ -4367,6 +4381,8 @@ void QOpenGLPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, con
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
+ if (tex->options & QGLContext::InvertedYBindOption)
+ glPopMatrix();
glDisable(GL_TEXTURE_2D);
#ifndef QT_OPENGL_ES
@@ -4402,13 +4418,15 @@ void QOpenGLPaintEngine::drawImage(const QRectF &r, const QImage &image, const Q
else {
GLenum target = qt_gl_preferredTextureTarget();
d->flushDrawQueue();
- d->device->context()->bindTexture(image, target);
- drawTextureRect(image.width(), image.height(), r, sr, target);
+ QGLTexture *tex =
+ d->device->context()->d_func()->bindTexture(image, target, GL_RGBA,
+ QGLContext::InternalBindOption);
+ drawTextureRect(image.width(), image.height(), r, sr, target, tex);
}
}
void QOpenGLPaintEngine::drawTextureRect(int tx_width, int tx_height, const QRectF &r,
- const QRectF &sr, GLenum target)
+ const QRectF &sr, GLenum target, QGLTexture *tex)
{
Q_D(QOpenGLPaintEngine);
#ifndef QT_OPENGL_ES
@@ -4423,8 +4441,13 @@ void QOpenGLPaintEngine::drawTextureRect(int tx_width, int tx_height, const QRec
if (target == GL_TEXTURE_2D) {
x1 = sr.x() / tx_width;
x2 = x1 + sr.width() / tx_width;
- y1 = 1 - (sr.bottom() / tx_height);
- y2 = 1 - (sr.y() / tx_height);
+ if (tex->options & QGLContext::InvertedYBindOption) {
+ y1 = 1 - (sr.bottom() / tx_height);
+ y2 = 1 - (sr.y() / tx_height);
+ } else {
+ y1 = sr.bottom() / tx_height;
+ y2 = sr.y() / tx_height;
+ }
} else {
x1 = sr.x();
x2 = sr.right();
@@ -5179,9 +5202,12 @@ void QOpenGLPaintEnginePrivate::composite(GLuint primitive, const q_vertexType *
glActiveTexture(GL_TEXTURE0 + brush_texture_location);
if (current_style == Qt::TexturePattern)
- device->context()->bindTexture(cbrush.textureImage());
+ device->context()->d_func()->bindTexture(cbrush.textureImage(), GL_TEXTURE_2D, GL_RGBA,
+ QGLContext::InternalBindOption);
else
- device->context()->bindTexture(qt_imageForBrush(current_style, true));
+ device->context()->d_func()->bindTexture(qt_imageForBrush(current_style, true),
+ GL_TEXTURE_2D, GL_RGBA,
+ QGLContext::InternalBindOption);
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, use_smooth_pixmap_transform);
}
diff --git a/src/opengl/qpaintengine_opengl_p.h b/src/opengl/qpaintengine_opengl_p.h
index 1cac3ade65..13299da8f9 100644
--- a/src/opengl/qpaintengine_opengl_p.h
+++ b/src/opengl/qpaintengine_opengl_p.h
@@ -146,7 +146,8 @@ public:
private:
void drawPolyInternal(const QPolygonF &pa, bool close = true);
- void drawTextureRect(int tx_width, int tx_height, const QRectF &r, const QRectF &sr, GLenum target);
+ void drawTextureRect(int tx_width, int tx_height, const QRectF &r, const QRectF &sr,
+ GLenum target, QGLTexture *tex);
Q_DISABLE_COPY(QOpenGLPaintEngine)
};
diff --git a/tests/auto/q3popupmenu/tst_q3popupmenu.cpp b/tests/auto/q3popupmenu/tst_q3popupmenu.cpp
index 3be416c284..5585c3abf1 100644
--- a/tests/auto/q3popupmenu/tst_q3popupmenu.cpp
+++ b/tests/auto/q3popupmenu/tst_q3popupmenu.cpp
@@ -117,6 +117,8 @@ void tst_Q3PopupMenu::task177490_highlighted()
QApplication::processEvents();
#endif
Q3PopupMenu menu1;
+ //don't let the window manager move the popup while we are testing
+ menu1.setWindowFlags(Qt::X11BypassWindowManagerHint);
menu1.insertItem("Item 1");
Q3PopupMenu menu2;
@@ -133,16 +135,12 @@ void tst_Q3PopupMenu::task177490_highlighted()
QTest::mouseMove(&menu1, QPoint(x, y1));
QTest::mouseMove(&menu1, QPoint(x, y1 + 1));
- QTest::qWait(1000);
+ QTest::qWait(100);
QTest::mouseMove(&menu1, QPoint(x, y2));
QTest::mouseMove(&menu1, QPoint(x, y2 + 1));
- QTest::qWait(1000);
+ QTest::qWait(100);
- if (!menu2.isVisible())
- QEXPECT_FAIL(
- "", "expected failure due to visibilty/focus problem; to be investigated later",
- Abort);
QCOMPARE(spy.count(), 2); // one per menu item
}
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index b52cb7d1a1..bb0ea70f3e 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -2173,14 +2173,12 @@ void tst_QGraphicsView::viewportUpdateMode()
qt_x11_wait_for_window_manager(&view);
#endif
QTest::qWait(50);
+ QTRY_VERIFY(!view.lastUpdateRegions.isEmpty());
view.lastUpdateRegions.clear();
// Issue two scene updates.
scene.update(QRectF(0, 0, 10, 10));
scene.update(QRectF(20, 0, 10, 10));
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
QTest::qWait(50);
// The view gets two updates for the update scene updates.
diff --git a/tests/auto/qwswindowsystem/tst_qwswindowsystem.cpp b/tests/auto/qwswindowsystem/tst_qwswindowsystem.cpp
index 3a2e79bfe7..014074acdf 100644
--- a/tests/auto/qwswindowsystem/tst_qwswindowsystem.cpp
+++ b/tests/auto/qwswindowsystem/tst_qwswindowsystem.cpp
@@ -239,6 +239,7 @@ void tst_QWSWindowSystem::windowOpacity()
QColor(255, 255, 255, 0));
w2.setPalette(palette);
QApplication::processEvents();
+ QApplication::processEvents();
QCOMPARE(win1->allocatedRegion(), QRegion(rect));
QCOMPARE(win2->allocatedRegion(), QRegion(rect));
VERIFY_COLOR(rect, w1.color());