summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-09-14 08:41:36 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-09-14 08:41:36 (GMT)
commit5e54649a29f65f32beb2c310fd2a81d60b901537 (patch)
tree1c44579d7869f258a050c055af01b87b7a6ed0c0
parent8d596ad475a5874c9d271799ee65e0607658c82b (diff)
parent9092d68e8a0d8124346069a8fe7949d64aebd178 (diff)
downloadQt-5e54649a29f65f32beb2c310fd2a81d60b901537.zip
Qt-5e54649a29f65f32beb2c310fd2a81d60b901537.tar.gz
Qt-5e54649a29f65f32beb2c310fd2a81d60b901537.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt into 4.6
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp21
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp2
-rw-r--r--src/gui/text/qfontdatabase_win.cpp2
-rw-r--r--tests/auto/qgl/tst_qgl.cpp13
5 files changed, 29 insertions, 11 deletions
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index 389bb48..8c4cc82 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -62,7 +62,7 @@
#elif defined(Q_OS_AIX)
# define NO_BOM
# define UTF16 "UCS-2"
-#elif defined(Q_OS_MAC)
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
# define NO_BOM
# if Q_BYTE_ORDER == Q_BIG_ENDIAN
# define UTF16 "UTF-16BE"
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 46a3362..bac0a76 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -114,7 +114,7 @@ extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); //
// #define QT_DEBUG_DRAW
#ifdef QT_DEBUG_DRAW
-void dumpClip(int width, int height, QClipData *clip);
+void dumpClip(int width, int height, const QClipData *clip);
#endif
#define QT_FAST_SPANS
@@ -495,7 +495,7 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
<< ") devType:" << device->devType()
<< "devRect:" << d->deviceRect;
if (d->baseClip) {
- dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), d->baseClip);
+ dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip);
}
#endif
@@ -534,7 +534,7 @@ bool QRasterPaintEngine::end()
Q_D(QRasterPaintEngine);
qDebug() << "QRasterPaintEngine::end devRect:" << d->deviceRect;
if (d->baseClip) {
- dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), d->baseClip);
+ dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->baseClip);
}
#endif
@@ -1181,6 +1181,11 @@ static void qrasterpaintengine_dirty_clip(QRasterPaintEnginePrivate *d, QRasterP
d->solid_color_filler.clip = d->clip();
d->solid_color_filler.adjustSpanMethods();
+
+#ifdef QT_DEBUG_DRAW
+ dumpClip(d->rasterBuffer->width(), d->rasterBuffer->height(), &*d->clip());
+#endif
+
}
@@ -1780,9 +1785,7 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
if (path.isEmpty())
return;
#ifdef QT_DEBUG_DRAW
- QRealRect vectorPathBounds = path.controlPointRect();
- QRectF rf(vectorPathBounds.x1, vectorPathBounds.y1,
- vectorPathBounds.x2 - vectorPathBounds.x1, vectorPathBounds.y2 - vectorPathBounds.y1);
+ QRectF rf = path.controlPointRect();
qDebug() << "QRasterPaintEngine::fill(): "
<< "size=" << path.elementCount()
<< ", hints=" << hex << path.hints()
@@ -6068,7 +6071,7 @@ static void drawEllipse_midpoint_i(const QRect &rect, const QRect &clip,
*/
#ifdef QT_DEBUG_DRAW
-void dumpClip(int width, int height, QClipData *clip)
+void dumpClip(int width, int height, const QClipData *clip)
{
QImage clipImg(width, height, QImage::Format_ARGB32_Premultiplied);
clipImg.fill(0xffff0000);
@@ -6078,8 +6081,10 @@ void dumpClip(int width, int height, QClipData *clip)
int y0 = height;
int y1 = 0;
+ ((QClipData *) clip)->spans(); // Force allocation of the spans structure...
+
for (int i = 0; i < clip->count; ++i) {
- QSpan *span = clip->spans() + i;
+ const QSpan *span = ((QClipData *) clip)->spans() + i;
for (int j = 0; j < span->len; ++j)
clipImg.setPixel(span->x + j, span->y, 0xffffff00);
x0 = qMin(x0, int(span->x));
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 5645950..0dc1832 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -586,7 +586,7 @@ bool QWindowsXPStylePrivate::swapAlphaChannel(const QRect &rect, bool allPixels)
}
register unsigned int alphaValue = (*buffer) & 0xFF000000;
if (alphaValue == 0xFF000000) {
- *buffer &= 0x00FFFFFF;
+ *buffer = 0;
valueChange = true;
} else if (alphaValue == 0) {
*buffer |= 0xFF000000;
diff --git a/src/gui/text/qfontdatabase_win.cpp b/src/gui/text/qfontdatabase_win.cpp
index 6b874af..ae26dab 100644
--- a/src/gui/text/qfontdatabase_win.cpp
+++ b/src/gui/text/qfontdatabase_win.cpp
@@ -471,7 +471,7 @@ static void initializeDb()
// print the database
for (int f = 0; f < db->count; f++) {
QtFontFamily *family = db->families[f];
- qDebug(" %s: %p", family->name.latin1(), family);
+ qDebug(" %s: %p", qPrintable(family->name), family);
populate_database(family->name);
#if 0
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index ebbfbae..a0b8b5d 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -81,6 +81,8 @@ private slots:
void stackedFBOs();
void colormap();
void fboFormat();
+
+ void testDontCrashOnDanglingResources();
};
tst_QGL::tst_QGL()
@@ -1513,5 +1515,16 @@ void tst_QGL::fboFormat()
QVERIFY(format1c != format4c);
}
+void tst_QGL::testDontCrashOnDanglingResources()
+{
+ // We have a number of Q_GLOBAL_STATICS inside the QtOpenGL
+ // library. This test is verify that we don't crash as a result of
+ // them calling into libgl on application shutdown.
+ QWidget *widget = new UnclippedWidget();
+ widget->show();
+ qApp->processEvents();
+ widget->hide();
+}
+
QTEST_MAIN(tst_QGL)
#include "tst_qgl.moc"