From patchwork Sat Jul 6 13:35:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Liu X-Patchwork-Id: 257240 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id B0C2E2C0096 for ; Sat, 6 Jul 2013 23:20:14 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5DEB98BEAC; Sat, 6 Jul 2013 13:20:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gbZ3IrxiHKRt; Sat, 6 Jul 2013 13:20:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 73BE38BE2D; Sat, 6 Jul 2013 13:20:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 66F938F74B for ; Sat, 6 Jul 2013 13:20:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3C9038C277 for ; Sat, 6 Jul 2013 13:20:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hHS8lFNopBko for ; Sat, 6 Jul 2013 13:20:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pb0-f44.google.com (mail-pb0-f44.google.com [209.85.160.44]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3124385959 for ; Sat, 6 Jul 2013 13:20:08 +0000 (UTC) Received: by mail-pb0-f44.google.com with SMTP id uo1so2895517pbc.3 for ; Sat, 06 Jul 2013 06:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=e+4xhYsmnrv6hezxeMx/QoevwpiptzU2/jhZyR9Vw/g=; b=Cg5LdZEz9tNescvXRCjUuv3tuElvk9z8rAq/HaJcBvux5b3ArGa+0CKbtoOvBLtMTV 90KGFhVJyKUKBBQc8nQuLfZgThJk5g5DQmia+Y4h5mq78V5HJObbePAj/qQgHEx0wNvC dC3UfQ9qnD/rNKBqcqzwQNBOfc8A1QRhlrS1ks/YoYZvOxtkG5Vl/qggQ6qRuUqgXqRC FqvQSP7+YXNm1ZxqwuOq6EyTk40EJ2Ij/ibrTM3F5wkFGUL2/EUE7io7Eg2fKfLnP3qb axQLFPWgb2F7cT7Uo4NBUlSFJ92KCBwWAJ0eifBO91BxPfALXYFIxGHiV8PDmEYBG+QR BHQQ== X-Received: by 10.68.180.34 with SMTP id dl2mr13854143pbc.57.1373116807964; Sat, 06 Jul 2013 06:20:07 -0700 (PDT) Received: from 60-242-179-244.static.tpgi.com.au (60-242-179-244.static.tpgi.com.au. [60.242.179.244]) by mx.google.com with ESMTPSA id v20sm13430724paj.4.2013.07.06.06.20.05 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 06 Jul 2013 06:20:06 -0700 (PDT) From: Jonathan Liu To: buildroot@busybox.net Date: Sat, 6 Jul 2013 23:35:31 +1000 Message-Id: <1373117731-4997-1-git-send-email-net147@gmail.com> X-Mailer: git-send-email 1.8.3.2 Subject: [Buildroot] [PATCH 1/1] qt: add patch for QTBUG-31579 to fix polyline drawing X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Jonathan Liu --- package/qt/qt-fix-polyline-drawing.patch | 145 +++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 package/qt/qt-fix-polyline-drawing.patch diff --git a/package/qt/qt-fix-polyline-drawing.patch b/package/qt/qt-fix-polyline-drawing.patch new file mode 100644 index 0000000..d0c3d07 --- /dev/null +++ b/package/qt/qt-fix-polyline-drawing.patch @@ -0,0 +1,145 @@ +From b7029fbd12c32e851ed7d81b692197176eb71d9e Mon Sep 17 00:00:00 2001 +From: Gunnar Sletta +Date: Thu, 4 Jul 2013 16:20:40 +1000 +Subject: [PATCH] Fix drawing of 0-width polylines from outside the devicerect. + +This was broken by a previous fix which aimed to fix gaps in +polylines with tiny line segments. The result was that we +skipped updating the origin point when stroke() didn't produce +pixels which accidentally included the case of the line +being completely outside the deviceRect. I fixed this +by returning the value of clipLine in drawLine to the caller +so we could still update the origin for this case. + +Task-number: QTBUG-31579 +Change-Id: Iac29436f042da7658bbeaf9370351dc6f2c95065 +(cherry picked from qtbase/900cccfd459fcbdbc4aa3d313afe12cfbf68fd87) +--- + src/gui/painting/qcosmeticstroker.cpp | 42 ++++++++++++++++++++++------------- + src/gui/painting/qcosmeticstroker_p.h | 2 +- + 2 files changed, 27 insertions(+), 17 deletions(-) + +diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp +index 0061ecb..4413170 100644 +--- a/src/gui/painting/qcosmeticstroker.cpp ++++ b/src/gui/painting/qcosmeticstroker.cpp +@@ -133,10 +133,15 @@ struct NoDasher { + + }; + ++/* ++ * The return value is the result of the clipLine() call performed at the start ++ * of each of the two functions, aka "false" means completely outside the devices ++ * rect. ++ */ + template +-static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); ++static bool drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); + template +-static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); ++static bool drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); + + inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) + { +@@ -602,17 +607,20 @@ void QCosmeticStroker::drawPath(const QVectorPath &path) + caps |= CapEnd; + + QCosmeticStroker::Point last = this->lastPixel; +- stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); ++ bool unclipped = stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); + + /* fix for gaps in polylines with fastpen and aliased in a sequence + of points with small distances: if current point p2 has been dropped +- out, keep last non dropped point p. */ +- if (fastPenAliased) { +- if (last.x != lastPixel.x || last.y != lastPixel.y || +- points == begin + 2 || points == end - 2 ) { +- { +- p = p2; +- } ++ out, keep last non dropped point p. ++ ++ However, if the line was completely outside the devicerect, we ++ still need to update p to avoid drawing the line after this one from ++ a bad starting position. ++ */ ++ if (fastPenAliased && unclipped) { ++ if (last.x != lastPixel.x || last.y != lastPixel.y ++ || points == begin + 2 || points == end - 2) { ++ p = p2; + } + } else { + p = p2; +@@ -720,10 +728,10 @@ static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) + the drawing shifts from horizontal to vertical or back. + */ + template +-static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) ++static bool drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) + { + if (stroker->clipLine(rx1, ry1, rx2, ry2)) +- return; ++ return false; + + static const int half = 31; + int x1 = toF26Dot6(rx1) + half; +@@ -813,7 +821,7 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, + } else { + // horizontal + if (!dx) +- return; ++ return true; + + QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; + +@@ -886,14 +894,15 @@ static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, + } + } + stroker->lastPixel = last; ++ return true; + } + + + template +-static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) ++static bool drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) + { + if (stroker->clipLine(rx1, ry1, rx2, ry2)) +- return; ++ return false; + + int x1 = toF26Dot6(rx1); + int y1 = toF26Dot6(ry1); +@@ -967,7 +976,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx + } else { + // horizontal + if (!dx) +- return; ++ return true; + + int yinc = F16Dot16FixedDiv(dy, dx); + +@@ -1029,6 +1038,7 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx + drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); + } + } ++ return true; + } + + QT_END_NAMESPACE +diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h +index 870738b..3216856 100644 +--- a/src/gui/painting/qcosmeticstroker_p.h ++++ b/src/gui/painting/qcosmeticstroker_p.h +@@ -56,7 +56,7 @@ QT_MODULE(Gui) + class QCosmeticStroker; + + +-typedef void (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); ++typedef bool (*StrokeLine)(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); + + class QCosmeticStroker + { +-- +1.8.3.2 +