summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qoutlinemapper_p.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-05-29 11:56:16 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-09 14:04:13 +0100
commit04413b9dd8f3983fd5471354a48ad1257ca4f290 (patch)
treed5483c6d5f07251c18306e7f29ccbe5430b0761c /src/gui/painting/qoutlinemapper_p.h
parentccc205bf38ffbe60180a069939a4aff01e7734e5 (diff)
Allow painting above INT16_MAX on 64-bit architectures
The logic in qgrayraster was ready for it except for an intermediate format. qrasterizer.cpp and qcosmeticstroker.cpp uses a dot-16 fixed point format, and had to be changed to handle higher coordinates on 64-bit architectures. Fixes: QTBUG-84428 Change-Id: I85ab7a04e38bd0dbcefa9f16c16ccc84785a33cf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/painting/qoutlinemapper_p.h')
-rw-r--r--src/gui/painting/qoutlinemapper_p.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/painting/qoutlinemapper_p.h b/src/gui/painting/qoutlinemapper_p.h
index 04a68797c2..b796fcca4b 100644
--- a/src/gui/painting/qoutlinemapper_p.h
+++ b/src/gui/painting/qoutlinemapper_p.h
@@ -66,10 +66,13 @@
QT_BEGIN_NAMESPACE
-// This limitations comes from qgrayraster.c. Any higher and
-// rasterization of shapes will produce incorrect results.
-const int QT_RASTER_COORD_LIMIT = 32767;
-
+// These limitations comes from qrasterizer.cpp, qcosmeticstroker.cpp, and qgrayraster.c.
+// Any higher and rasterization of shapes will produce incorrect results.
+#if Q_PROCESSOR_WORDSIZE == 8
+constexpr int QT_RASTER_COORD_LIMIT = ((1<<23) - 1); // F24dot8 in qgrayraster.c
+#else
+constexpr int QT_RASTER_COORD_LIMIT = ((1<<15) - 1); // F16dot16 in qrasterizer.cpp and qcosmeticstroker.cpp
+#endif
//#define QT_DEBUG_CONVERT
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale);