summaryrefslogtreecommitdiffstats
path: root/meta/recipes-qt
diff options
context:
space:
mode:
authorJonathan Liu <net147@gmail.com>2013-07-06 11:51:42 +1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-07-10 09:42:02 +0100
commit10cdbf1fd20125c53e7d292d381ddce1fe014eb4 (patch)
tree7af70a9d2a4f27149fdd22dbb2fc27f098f1fe82 /meta/recipes-qt
parentc44cb07de0e51cbe5cc9b865ee4624d1ebac3792 (diff)
downloadpoky-10cdbf1fd20125c53e7d292d381ddce1fe014eb4.tar.gz
qt4: add upstream QTBUG-31579 patch to fix polyline drawing regression
(From OE-Core rev: 9cec5833bd1a19794a0d7d77c2412d451dc30dc8) Signed-off-by: Jonathan Liu <net147@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-qt')
-rw-r--r--meta/recipes-qt/qt4/qt4-4.8.5.inc1
-rw-r--r--meta/recipes-qt/qt4/qt4-4.8.5/0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch148
2 files changed, 149 insertions, 0 deletions
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5.inc b/meta/recipes-qt/qt4/qt4-4.8.5.inc
index 810a01b654..d05b17464e 100644
--- a/meta/recipes-qt/qt4/qt4-4.8.5.inc
+++ b/meta/recipes-qt/qt4/qt4-4.8.5.inc
@@ -21,6 +21,7 @@ SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-ever
21 file://0018-configure-make-pulseaudio-a-configurable-option.patch \ 21 file://0018-configure-make-pulseaudio-a-configurable-option.patch \
22 file://0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch \ 22 file://0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch \
23 file://0020-webkit-disable-the-fuse-ld-gold-flag.patch \ 23 file://0020-webkit-disable-the-fuse-ld-gold-flag.patch \
24 file://0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch \
24 file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \ 25 file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \
25 file://g++.conf \ 26 file://g++.conf \
26 file://linux.conf \ 27 file://linux.conf \
diff --git a/meta/recipes-qt/qt4/qt4-4.8.5/0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch b/meta/recipes-qt/qt4/qt4-4.8.5/0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch
new file mode 100644
index 0000000000..ad45dd0511
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.5/0022-Fix-drawing-of-0-width-polylines-from-outside-the-de.patch
@@ -0,0 +1,148 @@
1From b7029fbd12c32e851ed7d81b692197176eb71d9e Mon Sep 17 00:00:00 2001
2From: Gunnar Sletta <gunnar.sletta@digia.com>
3Date: Thu, 4 Jul 2013 16:20:40 +1000
4Subject: [PATCH] Fix drawing of 0-width polylines from outside the devicerect.
5
6This was broken by a previous fix which aimed to fix gaps in
7polylines with tiny line segments. The result was that we
8skipped updating the origin point when stroke() didn't produce
9pixels which accidentally included the case of the line
10being completely outside the deviceRect. I fixed this
11by returning the value of clipLine in drawLine to the caller
12so we could still update the origin for this case.
13
14Upstream-Status: Accepted [https://codereview.qt-project.org/#change,60427]
15Signed-off-by: Jonathan Liu <net147@gmail.com>
16
17Task-number: QTBUG-31579
18Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065
19(cherry picked from qtbase/900cccfd459fcbdbc4aa3d313afe12cfbf68fd87)
20---
21 src/gui/painting/qcosmeticstroker.cpp | 42 ++++++++++++++++++++++-------------
22 src/gui/painting/qcosmeticstroker_p.h | 2 +-
23 2 files changed, 27 insertions(+), 17 deletions(-)
24
25diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
26index 0061ecb..4413170 100644
27--- a/src/gui/painting/qcosmeticstroker.cpp
28+++ b/src/gui/painting/qcosmeticstroker.cpp
29@@ -133,10 +133,15 @@ struct NoDasher {
30
31 };
32
33+/*
34+ * The return value is the result of the clipLine() call performed at the start
35+ * of each of the two functions, aka "false" means completely outside the devices
36+ * rect.
37+ */
38 template<DrawPixel drawPixel, class Dasher>
39-static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
40+static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
41 template<DrawPixel drawPixel, class Dasher>
42-static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
43+static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
44
45 inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage)
46 {
47@@ -602,17 +607,20 @@ void QCosmeticStroker::drawPath(const QVectorPath &path)
48 caps |= CapEnd;
49
50 QCosmeticStroker::Point last = this->lastPixel;
51- stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps);
52+ bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps);
53
54 /* fix for gaps in polylines with fastpen and aliased in a sequence
55 of points with small distances: if current point p2 has been dropped
56- out, keep last non dropped point p. */
57- if (fastPenAliased) {
58- if (last.x != lastPixel.x || last.y != lastPixel.y ||
59- points == begin + 2 || points == end - 2 ) {
60- {
61- p = p2;
62- }
63+ out, keep last non dropped point p.
64+
65+ However, if the line was completely outside the devicerect, we
66+ still need to update p to avoid drawing the line after this one from
67+ a bad starting position.
68+ */
69+ if (fastPenAliased && unclipped) {
70+ if (last.x != lastPixel.x || last.y != lastPixel.y
71+ || points == begin + 2 || points == end - 2) {
72+ p = p2;
73 }
74 } else {
75 p = p2;
76@@ -720,10 +728,10 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc)
77 the drawing shifts from horizontal to vertical or back.
78 */
79 template<DrawPixel drawPixel, class Dasher>
80-static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps)
81+static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps)
82 {
83 if (stroker->clipLine(rx1, ry1, rx2, ry2))
84- return;
85+ return false;
86
87 static const int half = 31;
88 int x1 = toF26Dot6(rx1) + half;
89@@ -813,7 +821,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2,
90 } else {
91 // horizontal
92 if (!dx)
93- return;
94+ return true;
95
96 QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight;
97
98@@ -886,14 +894,15 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2,
99 }
100 }
101 stroker->lastPixel = last;
102+ return true;
103 }
104
105
106 template<DrawPixel drawPixel, class Dasher>
107-static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps)
108+static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps)
109 {
110 if (stroker->clipLine(rx1, ry1, rx2, ry2))
111- return;
112+ return false;
113
114 int x1 = toF26Dot6(rx1);
115 int y1 = toF26Dot6(ry1);
116@@ -967,7 +976,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx
117 } else {
118 // horizontal
119 if (!dx)
120- return;
121+ return true;
122
123 int yinc = F16Dot16FixedDiv(dy, dx);
124
125@@ -1029,6 +1038,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx
126 drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6);
127 }
128 }
129+ return true;
130 }
131
132 QT_END_NAMESPACE
133diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
134index 870738b..3216856 100644
135--- a/src/gui/painting/qcosmeticstroker_p.h
136+++ b/src/gui/painting/qcosmeticstroker_p.h
137@@ -56,7 +56,7 @@ QT_MODULE(Gui)
138 class QCosmeticStroker;
139
140
141-typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
142+typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps);
143
144 class QCosmeticStroker
145 {
146--
1471.8.3.2
148