diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2012-10-10 12:38:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-19 02:43:05 +0200 |
commit | 7b8e10ddd02693b3d6b7a7e74d2103787f6e76ac (patch) | |
tree | 4147954620057575e543eb0b6f09385b265cefb3 /src/gui/painting/qpaintengine_raster_p.h | |
parent | ae3ad0ad211e6b9d745193fc049ad6ee07d731f0 (diff) | |
download | qtbase-7b8e10ddd02693b3d6b7a7e74d2103787f6e76ac.tar.gz |
Fixed inconsistent QPainter fill rules for aliased painting.
Qt 5 is the time to get rid of all the old inconsistencies in the raster
paint engine caused by trying to preserve the old X11 based
coordinate system where (0, 0) is in the center of the top-left pixel
instead of the upper left corner of said pixel. However, this was only
adhered for line drawing and path / rect filling, and not for image or
pixmap drawing and not at all when doing antialiased painting. By
defining the antialiased coordinate system as being the right one and
letting the aliased fill rules follow from that we finally end up with
some consistent behavior that doesn't lead to surprises and workarounds
in application code.
It is still possible for applications to get the old behavior by
setting the QPainter::Qt4CompatiblePainting render hint. This should
make porting easier for the few cases where an application relies on the
aliased fill rules we used to have in Qt 4.
Task-number: QTBUG-27500
Change-Id: If86b95e77d838ec83033d64af86632b9a73c74a9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/gui/painting/qpaintengine_raster_p.h')
-rw-r--r-- | src/gui/painting/qpaintengine_raster_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_raster_p.h b/src/gui/painting/qpaintengine_raster_p.h index e1beff047e..8fb72edabd 100644 --- a/src/gui/painting/qpaintengine_raster_p.h +++ b/src/gui/painting/qpaintengine_raster_p.h @@ -110,6 +110,7 @@ public: uint non_complex_pen : 1; // can use rasterizer, rather than stroker uint antialiased : 1; uint bilinear : 1; + uint legacy_rounding : 1; uint fast_text : 1; uint int_xform : 1; uint tx_noshear : 1; @@ -246,6 +247,8 @@ private: bool setClipRectInDeviceCoords(const QRect &r, Qt::ClipOperation op); + QRect toNormalizedFillRect(const QRectF &rect); + inline void ensureBrush(const QBrush &brush) { if (!qbrush_fast_equals(state()->lastBrush, brush) || (brush.style() != Qt::NoBrush && state()->fillFlags)) updateBrush(brush); |