From bd8f1171ea1d564bb9b8e04b1a220e5559d60423 Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Sun, 13 Sep 2009 09:40:37 +0200 Subject: Fix libiconv support on FreeBSD. For some reason iconv support was broken in Qt 4.5 on FreeBSD, and this patch was made to fix that. Original patch by Max Brazhnikov . Original message: Enable libiconv support. Didn't get where the real problem is, but using UTF-16LE/BE as default encoding (see patch) fixes the issue. Merge-request: 1480 Reviewed-by: Thiago Macieira --- src/corelib/codecs/qiconvcodec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp index 6153d70..e4389b9 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" -- cgit v0.12 From 2cc93f74b531c653fde19c52f925b20b04c69b36 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 10 Sep 2009 07:42:20 +0200 Subject: Autotest preventing gl from crashing on shutdown with dangling contexts --- tests/auto/qgl/tst_qgl.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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" -- cgit v0.12 From b7f3fe8557f4c4b9ec90449649a9a929f8f50393 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Fri, 11 Sep 2009 09:26:08 +0200 Subject: fix compile error debug output --- src/gui/text/qfontdatabase_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v0.12 From 97ac103fb5a0139c007c8e2073a7a2cee1423618 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 14 Sep 2009 07:13:40 +0200 Subject: Fixed compilation of some ifdef'ed out debug messages. Reviewed-by: trustme --- src/gui/painting/qpaintengine_raster.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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)); -- cgit v0.12 From 3aa5fec77b2e1edbcbd1d7735389725076f91cbf Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 14 Sep 2009 08:14:12 +0200 Subject: Fixed groupbox drawing on xp when hitting the fallback code. When swapping the alphachannel we need to make sure we create proper premultiplied pixels. When setting alpha to 0, that means also setting the other pixel values to 0. This bug was made visible by the gl graphics system. Reviewed-by: MariusSO --- src/gui/styles/qwindowsxpstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v0.12