summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2010-01-12 14:13:46 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2010-01-12 14:13:46 (GMT)
commitd4e81805ff47a266890f9638cf29647889d5c730 (patch)
tree40ea83c13910d795a75486b73cc0e3d001b51e70 /src/gui
parent54044ee128f0e2e2ecdbffd03de7241702fd4ba7 (diff)
downloadQt-d4e81805ff47a266890f9638cf29647889d5c730.zip
Qt-d4e81805ff47a266890f9638cf29647889d5c730.tar.gz
Qt-d4e81805ff47a266890f9638cf29647889d5c730.tar.bz2
Avoid coordinate limitations in the raster engine.
Lines that are longer than 2^15 will overflow in qgrayraster.c so we need to clip them. Also, we need to clip the bounding rectangle to avoid an endless clip-loop Task: http://bugreports.qt.nokia.com/browse/QTBUG-6198 Reviewed-by: Samuel
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qoutlinemapper.cpp9
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp4
2 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/painting/qoutlinemapper.cpp b/src/gui/painting/qoutlinemapper.cpp
index ee33024..078d002 100644
--- a/src/gui/painting/qoutlinemapper.cpp
+++ b/src/gui/painting/qoutlinemapper.cpp
@@ -225,9 +225,10 @@ void QOutlineMapper::endOutline()
controlPointRect = boundingRect(elements, element_count);
#ifdef QT_DEBUG_CONVERT
- printf(" - control point rect (%.2f, %.2f) %.2f x %.2f\n",
+ printf(" - control point rect (%.2f, %.2f) %.2f x %.2f, clip=(%d,%d, %dx%d)\n",
controlPointRect.x(), controlPointRect.y(),
- controlPointRect.width(), controlPointRect.height());
+ controlPointRect.width(), controlPointRect.height(),
+ m_clip_rect.x(), m_clip_rect.y(), m_clip_rect.width(), m_clip_rect.height());
#endif
@@ -235,7 +236,9 @@ void QOutlineMapper::endOutline()
const bool do_clip = (controlPointRect.left() < -QT_RASTER_COORD_LIMIT
|| controlPointRect.right() > QT_RASTER_COORD_LIMIT
|| controlPointRect.top() < -QT_RASTER_COORD_LIMIT
- || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT);
+ || controlPointRect.bottom() > QT_RASTER_COORD_LIMIT
+ || controlPointRect.width() > QT_RASTER_COORD_LIMIT
+ || controlPointRect.height() > QT_RASTER_COORD_LIMIT);
if (do_clip) {
clipElements(elements, elementTypes(), element_count);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index aa3b89e..eeb90e5 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -475,8 +475,10 @@ bool QRasterPaintEngine::begin(QPaintDevice *device)
QRasterPaintEngineState *s = state();
ensureOutlineMapper();
d->outlineMapper->m_clip_rect = d->deviceRect.adjusted(-10, -10, 10, 10);
+
+ // This is the upp
QRect bounds(-QT_RASTER_COORD_LIMIT, -QT_RASTER_COORD_LIMIT,
- 2*QT_RASTER_COORD_LIMIT, 2*QT_RASTER_COORD_LIMIT);
+ QT_RASTER_COORD_LIMIT*2 - 1, QT_RASTER_COORD_LIMIT * 2 - 1);
d->outlineMapper->m_clip_rect = bounds.intersected(d->outlineMapper->m_clip_rect);