commit:     94bf4289184ee4f99674091abe08ec9f072dccb3
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun May 24 22:32:05 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun May 24 22:32:05 2020 +0000
URL:        https://gitweb.gentoo.org/proj/qt.git/commit/?id=94bf4289

dev-qt/qtdeclarative: Backport fixes from 5.15.1

- Fix subpixel positioned text
  QTBUG: https://bugreports.qt.io/browse/QTBUG-49646

- QQuickItemView: Fix max(X/Y)Extent()
  KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=419514
  QTBUG: https://bugreports.qt.io/browse/QTBUG-83890

Bug: https://bugs.gentoo.org/716992
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...ve-5.14.2-QQuickItemView-fix-maxXY-extent.patch | 42 ++++++++++++++
 ...ative-5.14.2-fix-subpixel-positioned-text.patch | 64 ++++++++++++++++++++++
 .../qtdeclarative/qtdeclarative-5.15.0_rc2.ebuild  |  5 ++
 3 files changed, 111 insertions(+)

diff --git 
a/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-QQuickItemView-fix-maxXY-extent.patch
 
b/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-QQuickItemView-fix-maxXY-extent.patch
new file mode 100644
index 00000000..c9ccb211
--- /dev/null
+++ 
b/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-QQuickItemView-fix-maxXY-extent.patch
@@ -0,0 +1,42 @@
+From cc5387ad22ca503d167fd66e2429107d45b937af Mon Sep 17 00:00:00 2001
+From: David Redondo <q...@david-redondo.de>
+Date: Wed, 13 May 2020 11:04:23 +0200
+Subject: [PATCH] QQuickItemView: Fix max(X/Y)Extent()
+
+QQuickFlickable maxXExtent() and maxYExtent() return the amount of space
+that is not shown when inside a ScrollView. QQuickItemView however just
+returned width() if vertical and height() if horizontal. In these cases
+just defer to the QQuickFlickable base implementation like minXExtent()
+and minYExtent() already do.
+
+Fixes: QTBUG-83890
+Pick-to: 5.15
+Change-Id: I7f4060c2f46ae07611bedceca0d322c5f7f6affb
+---
+ src/quick/items/qquickitemview.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/quick/items/qquickitemview.cpp 
b/src/quick/items/qquickitemview.cpp
+index 7fb392233e4..ab130ac6857 100644
+--- a/src/quick/items/qquickitemview.cpp
++++ b/src/quick/items/qquickitemview.cpp
+@@ -1393,7 +1393,7 @@ qreal QQuickItemView::maxYExtent() const
+ {
+     Q_D(const QQuickItemView);
+     if (d->layoutOrientation() == Qt::Horizontal)
+-        return height();
++        return QQuickFlickable::maxYExtent();
+ 
+     if (d->vData.maxExtentDirty) {
+         d->maxExtent = d->maxExtentForAxis(d->vData, false);
+@@ -1421,7 +1421,7 @@ qreal QQuickItemView::maxXExtent() const
+ {
+     Q_D(const QQuickItemView);
+     if (d->layoutOrientation() == Qt::Vertical)
+-        return width();
++        return QQuickFlickable::maxXExtent();
+ 
+     if (d->hData.maxExtentDirty) {
+         d->maxExtent = d->maxExtentForAxis(d->hData, true);
+-- 
+2.16.3

diff --git 
a/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-fix-subpixel-positioned-text.patch
 
b/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-fix-subpixel-positioned-text.patch
new file mode 100644
index 00000000..23eaa7d5
--- /dev/null
+++ 
b/dev-qt/qtdeclarative/files/qtdeclarative-5.14.2-fix-subpixel-positioned-text.patch
@@ -0,0 +1,64 @@
+From e807f9d1d80559b8ff91f1c3cfdd755b3da56a6d Mon Sep 17 00:00:00 2001
+From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfe...@qt.io>
+Date: Tue, 5 May 2020 11:36:24 +0200
+Subject: [PATCH] Fix subpixel positioned text with Text.NativeRendering
+
+We would be generating subpixel positioned glyphs based on the
+relative positions of the glyphs, ignoring the fractional part
+contributed by the origin of the text. So if the text origin was
+inside a pixel, the subpixel antialiasing would be wrong and we
+would see kerning errors.
+
+This was especially visible when using AlignHCenter on text
+with hinting disabled and resizing the item it was aligning to.
+
+Pick-to: 5.15
+Task-number: QTBUG-49646
+Change-Id: I0e709ba2b5d2440e34c94c6f819befe0a65a113a
+Reviewed-by: Lars Knoll <lars.kn...@qt.io>
+Reviewed-by: Konstantin Ritt <ritt...@gmail.com>
+---
+ src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp 
b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+index cfa645bfd03..f73b64f537f 100644
+--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
++++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+@@ -789,11 +789,12 @@ void QSGTextMaskMaterial::populate(const QPointF &p,
+                                    const QMargins &margins)
+ {
+     Q_ASSERT(m_font.isValid());
++    QPointF position(p.x(), p.y() - m_font.ascent());
+     QVector<QFixedPoint> fixedPointPositions;
+     const int glyphPositionsSize = glyphPositions.size();
+     fixedPointPositions.reserve(glyphPositionsSize);
+     for (int i=0; i < glyphPositionsSize; ++i)
+-        
fixedPointPositions.append(QFixedPoint::fromPointF(glyphPositions.at(i)));
++        fixedPointPositions.append(QFixedPoint::fromPointF(position + 
glyphPositions.at(i)));
+ 
+     QTextureGlyphCache *cache = glyphCache();
+ 
+@@ -815,18 +816,16 @@ void QSGTextMaskMaterial::populate(const QPointF &p,
+     Q_ASSERT(geometry->sizeOfVertex() == sizeof(QVector4D));
+     ushort *ip = geometry->indexDataAsUShort();
+ 
+-    QPointF position(p.x(), p.y() - m_font.ascent());
+     bool supportsSubPixelPositions = 
fontD->fontEngine->supportsSubPixelPositions();
+     for (int i=0; i<glyphIndexes.size(); ++i) {
++         QPointF glyphPosition = glyphPositions.at(i) + position;
+          QFixed subPixelPosition;
+          if (supportsSubPixelPositions)
+-             subPixelPosition = 
fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPositions.at(i).x()));
++             subPixelPosition = 
fontD->fontEngine->subPixelPositionForX(QFixed::fromReal(glyphPosition.x()));
+ 
+          QTextureGlyphCache::GlyphAndSubPixelPosition 
glyph(glyphIndexes.at(i), subPixelPosition);
+          const QTextureGlyphCache::Coord &c = cache->coords.value(glyph);
+ 
+-         QPointF glyphPosition = glyphPositions.at(i) + position;
+-
+          // On a retina screen the glyph positions are not pre-scaled (as 
opposed to
+          // eg. the raster paint engine). To ensure that we get the same 
behavior as
+          // the raster engine (and CoreText itself) when it comes to rounding 
of the
+-- 
+2.16.3

diff --git a/dev-qt/qtdeclarative/qtdeclarative-5.15.0_rc2.ebuild 
b/dev-qt/qtdeclarative/qtdeclarative-5.15.0_rc2.ebuild
index 5e3c49a6..ffc90aff 100644
--- a/dev-qt/qtdeclarative/qtdeclarative-5.15.0_rc2.ebuild
+++ b/dev-qt/qtdeclarative/qtdeclarative-5.15.0_rc2.ebuild
@@ -27,6 +27,11 @@ RDEPEND="${DEPEND}
        !<dev-qt/qtquickcontrols-5.7:5
 "
 
+PATCHES=(
+       "${FILESDIR}/${PN}-5.14.2-QQuickItemView-fix-maxXY-extent.patch" # 
QTBUG-83890
+       "${FILESDIR}/${PN}-5.14.2-fix-subpixel-positioned-text.patch" # 
QTBUG-49646
+)
+
 src_prepare() {
        use jit || PATCHES+=("${FILESDIR}/${PN}-5.4.2-disable-jit.patch")
 

Reply via email to