From aeefa4897faba85ad1c26cd44de18957d078fdef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 7 Jan 2013 18:21:55 +0100 Subject: Don't assume QSurfaceFormat's stencil buffer size is >= 0 The value -1 is used to indicate no stencil buffer, so we have to check for sizes <= 0 when deciding whether or not to triangulate the path in QOpenGL2PaintEngineExPrivate::fill(). This fixes an issue where filling a path would end up filling the whole outline of the path, which was very visible with fonts over a certain size (when we go from using the glyph cache to drawing filled paths for each glyph). Change-Id: Iafa96124481936db1e5109bba6166a6038c7ca83 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/opengl/qopenglpaintengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/opengl/qopenglpaintengine.cpp b/src/gui/opengl/qopenglpaintengine.cpp index 624eeaffd9..596ef10f6e 100644 --- a/src/gui/opengl/qopenglpaintengine.cpp +++ b/src/gui/opengl/qopenglpaintengine.cpp @@ -877,7 +877,7 @@ void QOpenGL2PaintEngineExPrivate::fill(const QVectorPath& path) // Tag it for later so that if the same path is drawn twice, it is assumed to be static and thus cachable path.makeCacheable(); - if (device->context()->format().stencilBufferSize() == 0) { + if (device->context()->format().stencilBufferSize() <= 0) { // If there is no stencil buffer, triangulate the path instead. QRectF bbox = path.controlPointRect(); -- cgit v1.2.3 From b188d9481b98680deb7f44fb41f8eafce18aedab Mon Sep 17 00:00:00 2001 From: Jian Liang Date: Mon, 14 Jan 2013 10:39:56 +0800 Subject: Fix QOpenGLContextGroup object leak MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-29056 QOpenGLContextGroup object is designed to be destroyed by deleteLater(), but this method will not always work due to the fact that in many cases event loop will exit before the deferred deletion of the QOpenGLContextGroup object is queued. Think about the following case: int main(int argc, char *argv[]) { QApplication a(argc, argv); QGLWidget w; w.show(); return a.exec(); } In the above program, the event loop will exit before QGLWidget object's destruction. This will cause the QOpenGLContextGroup object hold by QGLWidget object never been deleted. This patch will delete QOpenGLContextGroup object directly with delete operator if the current thread is the same as the thread which the QOpenGLContextGroup lives in. Change-Id: If835d7482474f4a668763fc7c21b293a27f075fd Reviewed-by: Samuel Rødal Reviewed-by: Sean Harmer --- src/gui/kernel/qopenglcontext.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index f16f29718d..96b09342c7 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -759,15 +759,26 @@ void QOpenGLContextGroupPrivate::removeContext(QOpenGLContext *ctx) { Q_Q(QOpenGLContextGroup); - QMutexLocker locker(&m_mutex); - m_shares.removeOne(ctx); + bool deleteObject = false; + + { + QMutexLocker locker(&m_mutex); + m_shares.removeOne(ctx); - if (ctx == m_context && !m_shares.isEmpty()) - m_context = m_shares.first(); + if (ctx == m_context && !m_shares.isEmpty()) + m_context = m_shares.first(); + + if (!m_refs.deref()) { + cleanup(); + deleteObject = true; + } + } - if (!m_refs.deref()) { - cleanup(); - q->deleteLater(); + if (deleteObject) { + if (q->thread() == QThread::currentThread()) + delete q; // Delete directly to prevent leak, refer to QTBUG-29056 + else + q->deleteLater(); } } -- cgit v1.2.3 From e11cf63b0babcba8709cd39ff46e43e773f7fa9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 11 Jan 2013 16:58:43 +0100 Subject: Fix crash when trying to create paths for color-glyphs (Emoji) on Mac CoreText segfaults when creating paths for color-glyphs: 0 0x00007fff8fd41e69 in TFont::FindColourBitmapForGlyph () 1 0x00007fff8fd417ac in TFont::CreatePathForGlyph () 2 0x000000010567d1af in QCoreTextFontEngine::addGlyphsToPath (...) So we shortcut the code-path, since we don't support Emoji yet anyways. Task-number: QTBUG-28615 Change-Id: Ife16ae4959077d9eaaf6ea5cd1f27a4e2e01e7f5 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengineglyphcache_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qfontengineglyphcache_p.h b/src/gui/text/qfontengineglyphcache_p.h index 18440f22fa..092873a4d4 100644 --- a/src/gui/text/qfontengineglyphcache_p.h +++ b/src/gui/text/qfontengineglyphcache_p.h @@ -69,7 +69,8 @@ public: enum Type { Raster_RGBMask, Raster_A8, - Raster_Mono + Raster_Mono, + Raster_ARGB }; QFontEngineGlyphCache(const QTransform &matrix, Type type) : m_transform(matrix), m_type(type) { } -- cgit v1.2.3 From 71a7ad80c0fd908fd743ff1f4919a72997568e3e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jan 2013 10:56:19 +0100 Subject: Fix warning about missing enumeration value. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If97a325d056282a033cdb4c6e5bdc79eb400c525 Reviewed-by: Tor Arne Vestbø --- src/gui/painting/qtextureglyphcache.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui') diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 43243b7c34..a9d5e21b50 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -305,6 +305,8 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) case QFontEngineGlyphCache::Raster_RGBMask: m_image = QImage(width, height, QImage::Format_RGB32); break; + case QFontEngineGlyphCache::Raster_ARGB: + break; } } -- cgit v1.2.3