public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas Sturmlechner" <asturm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtdeclarative/, dev-qt/qtdeclarative/files/
Date: Mon, 18 May 2020 06:20:26 +0000 (UTC)	[thread overview]
Message-ID: <1589782662.a620049c0bbf5ae9b456f175b279a11a035bcf9f.asturm@gentoo> (raw)

commit:     a620049c0bbf5ae9b456f175b279a11a035bcf9f
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun May 17 23:05:56 2020 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon May 18 06:17:42 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a620049c

dev-qt/qtdeclarative: Fix subpixel positioned text

QTBUG: https://bugreports.qt.io/browse/QTBUG-49646
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 ...ative-5.14.2-fix-subpixel-positioned-text.patch | 64 ++++++++++++++++++++++
 .../qtdeclarative/qtdeclarative-5.14.2-r2.ebuild   | 58 ++++++++++++++++++++
 2 files changed, 122 insertions(+)

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 00000000000..23eaa7d5100
--- /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-blomfeldt@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.knoll@qt.io>
+Reviewed-by: Konstantin Ritt <ritt.ks@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.14.2-r2.ebuild b/dev-qt/qtdeclarative/qtdeclarative-5.14.2-r2.ebuild
new file mode 100644
index 00000000000..77890662b25
--- /dev/null
+++ b/dev-qt/qtdeclarative/qtdeclarative-5.14.2-r2.ebuild
@@ -0,0 +1,58 @@
+# Copyright 2009-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8} )
+inherit python-any-r1 qt5-build
+
+DESCRIPTION="The QML and Quick modules for the Qt5 framework"
+
+if [[ ${QT5_BUILD_TYPE} == release ]]; then
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+fi
+
+IUSE="gles2-only +jit localstorage vulkan +widgets"
+
+BDEPEND="${PYTHON_DEPS}"
+# qtgui[gles2-only=] is needed because of bug 504322
+DEPEND="
+	~dev-qt/qtcore-${PV}
+	~dev-qt/qtgui-${PV}[gles2-only=,vulkan=]
+	~dev-qt/qtnetwork-${PV}
+	~dev-qt/qttest-${PV}
+	localstorage? ( ~dev-qt/qtsql-${PV} )
+	widgets? ( ~dev-qt/qtwidgets-${PV}[gles2-only=] )
+"
+RDEPEND="${DEPEND}
+	!<dev-qt/qtquickcontrols-5.7:5
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-QQuickItemView-fix-maxXY-extent.patch" # QTBUG-83890
+	"${FILESDIR}/${P}-fix-subpixel-positioned-text.patch" # QTBUG-49646
+)
+
+src_prepare() {
+	use jit || PATCHES+=("${FILESDIR}/${PN}-5.4.2-disable-jit.patch")
+
+	qt_use_disable_mod localstorage sql \
+		src/imports/imports.pro
+
+	qt_use_disable_mod widgets widgets \
+		src/src.pro \
+		src/qmltest/qmltest.pro \
+		tests/auto/auto.pro \
+		tools/tools.pro \
+		tools/qmlscene/qmlscene.pro \
+		tools/qml/qml.pro
+
+	qt5-build_src_prepare
+}
+
+src_configure() {
+	local myqmakeargs=(
+		--
+		-qml-debug
+	)
+	qt5-build_src_configure
+}


             reply	other threads:[~2020-05-18  6:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18  6:20 Andreas Sturmlechner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-25  7:13 [gentoo-commits] repo/gentoo:master commit in: dev-qt/qtdeclarative/, dev-qt/qtdeclarative/files/ Ionen Wolkens
2024-10-08 17:46 Ionen Wolkens
2021-07-17 22:45 Yixun Lan
2020-06-10 17:53 Andreas Sturmlechner
2020-05-17  0:24 Andreas Sturmlechner
2019-11-20 21:21 Andreas Sturmlechner
2015-08-24  1:28 Davide Pesavento

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1589782662.a620049c0bbf5ae9b456f175b279a11a035bcf9f.asturm@gentoo \
    --to=asturm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox