summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qcosmeticstroker_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-08-19 11:58:18 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-31 13:12:43 +0200
commit46ff3a4b1f0ee9fc87bafe2679f322aab689889c (patch)
tree90cfc482273d90c83e75bf21c929e2d2269d52a6 /src/gui/painting/qcosmeticstroker_p.h
parentdd91701a502859e57a095fccebde502c6abc458b (diff)
Correctly position aliased lines with flat caps
The code was mispositioning lines by half a pixel, as it added half a pixel offset and then rounded in addition. This submit fixes this and also removes certain artifacts when drawing rects at .5 pixel positions. Lance now doesn't show any significant differences to the 4.7 rendering anymore. Task-number: QTBUG-20199 Reviewed-by: Aavit (cherry picked from commit 49409f612c47f30434aa809e4d2c963f1a6bb88a) Change-Id: Iab3936e688eba16b82f5cdb4f36f54af807d78ea Reviewed-on: http://codereview.qt.nokia.com/3260 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/gui/painting/qcosmeticstroker_p.h')
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index d7bd79ad15..53cdf2c0ac 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -78,10 +78,12 @@ public:
// used to avoid drop outs or duplicated points
enum Direction {
- TopToBottom,
- BottomToTop,
- LeftToRight,
- RightToLeft
+ TopToBottom = 0x1,
+ BottomToTop = 0x2,
+ LeftToRight = 0x4,
+ RightToLeft = 0x8,
+ VerticalMask = 0x3,
+ HorizontalMask = 0xc
};
QCosmeticStroker(QRasterPaintEngineState *s, const QRect &dr)