summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-08-17 10:10:43 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-08-17 10:10:43 (GMT)
commit6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d (patch)
treebcfdce8b93f85047a01848331ac215082f619482 /src
parent87e9034caf90fb02ae2564947b9cbf464b3ca97c (diff)
parentff405f5623d7ed18c881c097368e3e9afd2e9443 (diff)
downloadQt-6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d.zip
Qt-6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d.tar.gz
Qt-6de735b5793aa1c5ddcba65b1110d3f9e1c64d1d.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1: Outline / fill inconsistency in X11 paint engine. Cocoa: parent windows shows on screen when they should be hidden Prevented Xorg crash in qtdemo when running corkboards example.
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget_mac.mm22
-rw-r--r--src/gui/painting/qpaintengine_x11.cpp8
-rw-r--r--src/opengl/qgl.cpp30
-rw-r--r--src/opengl/qgl_p.h3
4 files changed, 48 insertions, 15 deletions
diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm
index 8ae6a99..4ed4ccc 100644
--- a/src/gui/kernel/qwidget_mac.mm
+++ b/src/gui/kernel/qwidget_mac.mm
@@ -2796,10 +2796,16 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
if (QWidget *parent = q->parentWidget()) {
if (parent->testAttribute(Qt::WA_WState_Created)) {
- if (set)
- [qt_mac_window_for(parent) addChildWindow:qt_mac_window_for(q) ordered:NSWindowAbove];
- else
+ if (set) {
+ if (parent->isVisible()) {
+ NSWindow *childwin = qt_mac_window_for(q);
+ int childLevel = [childwin level];
+ [qt_mac_window_for(parent) addChildWindow:childwin ordered:NSWindowAbove];
+ [childwin setLevel:childLevel];
+ }
+ } else {
[qt_mac_window_for(parent) removeChildWindow:qt_mac_window_for(q)];
+ }
}
}
@@ -2807,10 +2813,14 @@ void QWidgetPrivate::setSubWindowStacking(bool set)
for (int i=0; i<widgets.size(); ++i) {
QWidget *child = widgets.at(i);
if (child->isWindow() && child->testAttribute(Qt::WA_WState_Created) && child->isVisibleTo(q)) {
- if (set)
- [qt_mac_window_for(q) addChildWindow:qt_mac_window_for(child) ordered:NSWindowAbove];
- else
+ if (set) {
+ NSWindow *childwin = qt_mac_window_for(child);
+ int childLevel = [childwin level];
+ [qt_mac_window_for(q) addChildWindow:childwin ordered:NSWindowAbove];
+ [childwin setLevel:childLevel];
+ } else {
[qt_mac_window_for(q) removeChildWindow:qt_mac_window_for(child)];
+ }
}
}
}
diff --git a/src/gui/painting/qpaintengine_x11.cpp b/src/gui/painting/qpaintengine_x11.cpp
index e521e01..5307142 100644
--- a/src/gui/painting/qpaintengine_x11.cpp
+++ b/src/gui/painting/qpaintengine_x11.cpp
@@ -1516,8 +1516,8 @@ void QX11PaintEnginePrivate::fillPolygon_translated(const QPointF *polygonPoints
for (int i = 0; i < pointCount; ++i) {
translated_points[i] = polygonPoints[i] + offset;
- translated_points[i].rx() = qRound(translated_points[i].x()) + offs;
- translated_points[i].ry() = qRound(translated_points[i].y()) + offs;
+ translated_points[i].rx() = qFloor(translated_points[i].x()) + offs;
+ translated_points[i].ry() = qFloor(translated_points[i].y()) + offs;
}
fillPolygon_dev(translated_points.data(), pointCount, gcMode, mode);
@@ -1754,8 +1754,8 @@ void QX11PaintEnginePrivate::fillPath(const QPainterPath &path, QX11PaintEngineP
for (int j = 0; j < polys.at(i).size(); ++j) {
translated_points[j] = polys.at(i).at(j);
if (!X11->use_xrender || !(render_hints & QPainter::Antialiasing)) {
- translated_points[j].rx() = qRound(translated_points[j].rx() + aliasedCoordinateDelta) + offs;
- translated_points[j].ry() = qRound(translated_points[j].ry() + aliasedCoordinateDelta) + offs;
+ translated_points[j].rx() = qFloor(translated_points[j].rx() + aliasedCoordinateDelta) + offs;
+ translated_points[j].ry() = qFloor(translated_points[j].ry() + aliasedCoordinateDelta) + offs;
}
}
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 4daa866..74bde36 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -1688,6 +1688,10 @@ void QGLContextPrivate::init(QPaintDevice *dev, const QGLFormat &format)
workaround_needsFullClearOnEveryFrame = false;
workaround_brokenFBOReadBack = false;
workaroundsCached = false;
+
+ workaround_brokenTextureFromPixmap = false;
+ workaround_brokenTextureFromPixmap_init = false;
+
for (int i = 0; i < QT_GL_VERTEX_ARRAY_TRACKED_COUNT; ++i)
vertexAttributeArraysEnabledState[i] = false;
}
@@ -2570,11 +2574,27 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
&& xinfo && xinfo->screen() == pixmap.x11Info().screen()
&& target == GL_TEXTURE_2D)
{
- texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options);
- if (texture) {
- texture->options |= QGLContext::MemoryManagedBindOption;
- texture->boundPixmap = pd;
- boundPixmaps.insert(pd, QPixmap(pixmap));
+ if (!workaround_brokenTextureFromPixmap_init) {
+ workaround_brokenTextureFromPixmap_init = true;
+
+ const QByteArray versionString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
+ const int pos = versionString.indexOf("NVIDIA ");
+
+ if (pos >= 0) {
+ const QByteArray nvidiaVersionString = versionString.mid(pos + strlen("NVIDIA "));
+
+ if (nvidiaVersionString.startsWith("195") || nvidiaVersionString.startsWith("256"))
+ workaround_brokenTextureFromPixmap = true;
+ }
+ }
+
+ if (!workaround_brokenTextureFromPixmap) {
+ texture = bindTextureFromNativePixmap(const_cast<QPixmap*>(&pixmap), key, options);
+ if (texture) {
+ texture->options |= QGLContext::MemoryManagedBindOption;
+ texture->boundPixmap = pd;
+ boundPixmaps.insert(pd, QPixmap(pixmap));
+ }
}
}
#endif
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 32feacd..ca0d3fa 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -393,6 +393,9 @@ public:
uint workaround_brokenFBOReadBack : 1;
uint workaroundsCached : 1;
+ uint workaround_brokenTextureFromPixmap : 1;
+ uint workaround_brokenTextureFromPixmap_init : 1;
+
QPaintDevice *paintDevice;
QColor transpColor;
QGLContext *q_ptr;