From ce2815b43c3f10c474c35d30197e14c58c9106ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 19 Aug 2016 14:44:21 +0200 Subject: Guard against calling QWindow::requestUpdate() on non-GUI threads Change-Id: I851ff672bc234146deb61615fc7c56df87d62065 Reviewed-by: Laszlo Agocs Reviewed-by: Timur Pocheptsov --- src/gui/kernel/qwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 2e212e5fdb..bcd29b6fe1 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2160,6 +2160,9 @@ void QWindowPrivate::deliverUpdateRequest() */ void QWindow::requestUpdate() { + Q_ASSERT_X(QThread::currentThread() == QCoreApplication::instance()->thread(), + "QWindow", "Updates can only be scheduled from the GUI (main) thread"); + Q_D(QWindow); if (d->updateRequestPending || !d->platformWindow) return; -- cgit v1.2.3 From 2ca4fd401b90831857a0dcd643e5d382feb75cb0 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 5 Aug 2016 14:43:15 +0200 Subject: QIcon: Set the pixmap's dpr to 1.0 if the window is also set to 1.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the pixmap is initially from a higher device pixel ratio and it is being used on a window that does not have a device pixel ratio other than 1.0 set then the pixmap should also have it set to 1.0. This ensures that the size of the pixmap is preserved and it is not scaled down as a result on the normal display. Change-Id: Ie5d96b3e1508867b723000bea182c8157640af02 Reviewed-by: Morten Johan Sørvig --- src/gui/image/qicon.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index e1e5367766..3531be412e 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -835,8 +835,11 @@ QPixmap QIcon::pixmap(QWindow *window, const QSize &size, Mode mode, State state qreal devicePixelRatio = qt_effective_device_pixel_ratio(window); // Handle the simple normal-dpi case: - if (!(devicePixelRatio > 1.0)) - return d->engine->pixmap(size, mode, state); + if (!(devicePixelRatio > 1.0)) { + QPixmap pixmap = d->engine->pixmap(size, mode, state); + pixmap.setDevicePixelRatio(1.0); + return pixmap; + } // Try get a pixmap that is big enough to be displayed at device pixel resolution. QPixmap pixmap = d->engine->pixmap(size * devicePixelRatio, mode, state); -- cgit v1.2.3 From 013210e9dae24288f4e408b4a574433da435ab8a Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Tue, 30 Aug 2016 19:29:37 -0700 Subject: Fix unused variable warning on iOS Change-Id: Ieae5d7833b45a49a743a52a437d5383bd8a962c5 Reviewed-by: Thiago Macieira --- src/gui/opengl/qopenglframebufferobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/opengl/qopenglframebufferobject.cpp b/src/gui/opengl/qopenglframebufferobject.cpp index 1ee90a0827..56e04c09d8 100644 --- a/src/gui/opengl/qopenglframebufferobject.cpp +++ b/src/gui/opengl/qopenglframebufferobject.cpp @@ -1281,11 +1281,11 @@ static inline QImage qt_gl_read_framebuffer_rgba8(const QSize &size, bool includ ? context->hasExtension(QByteArrayLiteral("GL_EXT_read_format_bgra")) : context->hasExtension(QByteArrayLiteral("GL_EXT_bgra")); +#ifndef Q_OS_IOS const char *renderer = reinterpret_cast(funcs->glGetString(GL_RENDERER)); const char *ver = reinterpret_cast(funcs->glGetString(GL_VERSION)); // Blacklist GPU chipsets that have problems with their BGRA support. -#ifndef Q_OS_IOS const bool blackListed = (qstrcmp(renderer, "PowerVR Rogue G6200") == 0 && ::strstr(ver, "1.3") != 0) || (qstrcmp(renderer, "Mali-T760") == 0 -- cgit v1.2.3 From c8cb188dd47d89da18f44a08557ca875baefcba7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 23 Aug 2016 16:40:56 +0200 Subject: Ensure the fontdatabase is initialized when requesting fallbacks Otherwise we will return an empty list of fallbacks if no QFontDatabase has been created yet. Task-number: QTBUG-55222 Change-Id: I50508162fad3206e0acf3cc6eb39aefac5c3e197 Reviewed-by: Peter Varga Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui') diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 0621f2a524..f063541249 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -840,9 +840,13 @@ QStringList QPlatformFontDatabase::fallbacksForFamily(const QString &family, QFo return retList; } +static void initializeDb(); + static QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) { QFontDatabasePrivate *db = privateDb(); + if (!db->count) + initializeDb(); const FallbacksCacheKey cacheKey = { family, style, styleHint, script }; -- cgit v1.2.3 From 24bd7fd6518985f00e4102c2702ef50a8852b731 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 1 Sep 2016 14:00:58 +0200 Subject: Fix crash when rendering to grayscale8 images An entry was missing in one of the tables. This patch adds it back in and adds the enum comments used to keep track of whether they all are there and correctly set. Change-Id: Ic6a55a8f81f9c42a3174a2a75c80c3a354f173b7 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/painting/qdrawhelper.cpp | 65 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 32 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index ac22c7fc00..ee3863ceb8 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5384,17 +5384,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, // ARGB32 blend_transformed_argb, // ARGB32_Premultiplied blend_transformed_rgb565, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, + blend_src_generic, // ARGB8565_Premultiplied + blend_src_generic, // RGB666 + blend_src_generic, // ARGB6666_Premultiplied + blend_src_generic, // RGB555 + blend_src_generic, // ARGB8555_Premultiplied + blend_src_generic, // RGB888 + blend_src_generic, // RGB444 + blend_src_generic, // ARGB4444_Premultiplied + blend_src_generic, // RGBX8888 + blend_src_generic, // RGBA8888 + blend_src_generic, // RGBA8888_Premultiplied blend_src_generic_rgb64, blend_src_generic_rgb64, blend_src_generic_rgb64, @@ -5412,16 +5412,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, // ARGB32 blend_transformed_tiled_argb, // ARGB32_Premultiplied blend_transformed_tiled_rgb565, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, + blend_src_generic, // ARGB8565_Premultiplied + blend_src_generic, // RGB666 + blend_src_generic, // ARGB6666_Premultiplied + blend_src_generic, // RGB555 + blend_src_generic, // ARGB8555_Premultiplied + blend_src_generic, // RGB888 + blend_src_generic, // RGB444 + blend_src_generic, // ARGB4444_Premultiplied + blend_src_generic, // RGBX8888 + blend_src_generic, // RGBA8888 + blend_src_generic, // RGBA8888_Premultiplied blend_src_generic_rgb64, blend_src_generic_rgb64, blend_src_generic_rgb64, @@ -5439,17 +5440,17 @@ static const ProcessSpans processTextureSpans[NBlendTypes][QImage::NImageFormats blend_src_generic, // ARGB32 blend_src_generic, // ARGB32_Premultiplied blend_transformed_bilinear_rgb565, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, - blend_src_generic, + blend_src_generic, // ARGB8565_Premultiplied + blend_src_generic, // RGB666 + blend_src_generic, // ARGB6666_Premultiplied + blend_src_generic, // RGB555 + blend_src_generic, // ARGB8555_Premultiplied + blend_src_generic, // RGB888 + blend_src_generic, // RGB444 + blend_src_generic, // ARGB4444_Premultiplied + blend_src_generic, // RGBX8888 + blend_src_generic, // RGBA8888 + blend_src_generic, // RGBA8888_Premultiplied blend_src_generic_rgb64, blend_src_generic_rgb64, blend_src_generic_rgb64, -- cgit v1.2.3